GNU social is an open source social media platform. Users on your own server can follow users on other servers and vice versa, essentially making it a distributed social media platform. It doesn’t do a whole lot but what it does it does well.

I’m installing on Debian 8.

Install Debian with the web server role installed. If you are installing on an existing server without a web server do

# tasksel, select web server and choose Ok.

Create the database

Create a database for GNU social:

# mysql -u root -p
CREATE DATABASE gnusocial;
CREATE USER gnusocial;
SET PASSWORD FOR gnusocial=PASSWORD("Passw0rd");
GRANT ALL PRIVILEGES on gnusocial.* TO gnusocial@localhost IDENTIFIED BY "Passw0rd";
FLUSH PRIVILEGES;
EXIT

Download the code

At the moment GNU social is being packaged for Debian so for the time being we should use git to download the code.

Install git:

# aptitude install git

Change to the web root and download GNU social:

# cd /var/www
# git clone https://git.gnu.io/gnu/gnu-social.git

Configure Apache

In /etc/apache2/sites-available/000-default.conf change

# ServerName www.example.com
DocumentRoot /var/www/html

to

ServerName www.example.com
DocumentRoot /var/www/gnu-social
<Directory /var/www/gnu-social/>
    AllowOverride All
    Order Deny,Allow
    Allow from all
</Directory>

Replace www.example.com by your own domain name.

Enable pretty URL’s: enable the rewrite mod in Apache and copy the htaccess file:

# a2enmod rewrite
# mv /var/www/gnu-social/htaccess.sample /var/www/gnu-social/.htaccess

Set permissions on the GNU social folder:

# chown -R www-data:www-data /var/www/gnu-social

Reload Apache to reflect the changes:

# service apache2 reload

Configuration via browser

Open the site in your browser: http://www.example.com/install.php

Database settings:
Hostname: localhost
Name: gnusocial
DB username: gnusocial
DB password: Passw0rd

After this setup GNU social throws me a bunch of errors but it works anyway.

Tweaks

To install a theme check /var/www/gnu-social/theme/ to see which themes are available. Pick one and in /var/www/gnu-social/config.php add the line

$config['site']['theme'] = 'yourthemename';