How to Install GNU Social on Pop! OS

This tutorial will guide you on how to install GNU Social on the latest version of Pop! OS.

Prerequisites

Before you start the installation process of GNU Social, please make sure that you have the following prerequisites installed on your system:

If you don't have any of the above-mentioned software installed on your system, you can use the following commands to install them on Pop! OS:

sudo apt-get install apache2 postgresql php7.2 git

Install Dependencies

After you have installed the prerequisites, you need to install the dependencies for GNU Social. Use the following command to install the dependencies:

sudo apt-get install php7.2-cli php7.2-gd php7.2-mysqli php7.2-json php7.2-curl php7.2-xml

Download GNU Social

Once you have installed the dependencies, you can proceed to download GNU Social from the official website. Open the terminal and run the following command:

git clone https://git.gnu.io/gnu/gnu-social.git

Configure Apache

After downloading GNU Social, you need to configure Apache to serve the GNU Social directory. Open the Apache configuration file with the following command:

sudo nano /etc/apache2/sites-available/gnusocial.conf

Add the following lines to the file:

<VirtualHost *:80>
    ServerName YOUR_DOMAIN_NAME
    DocumentRoot /path/to/gnusocial/
    <Directory /path/to/gnusocial/>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Replace YOUR_DOMAIN_NAME with your own domain name and /path/to/gnusocial/ with the path where you downloaded GNU Social.

Save the changes and exit the editor.

Enable the newly created virtual host by entering the following command:

sudo a2ensite gnusocial.conf

Finally, restart Apache to apply the changes:

sudo systemctl restart apache2

Configure PostgreSQL

GNU Social requires a PostgreSQL database to work. If you haven't already created a PostgreSQL user and database, you can create them using the following commands:

sudo -u postgres createuser --interactive
sudo -u postgres createdb --owner=USERNAME GNUSOCIAL_DB_NAME

Replace USERNAME with your own PostgreSQL username, and GNUSOCIAL_DB_NAME with the name of the PostgreSQL database you want to use for GNU Social.

Configure GNU Social

Navigate to the directory where you downloaded GNU Social and rename the config.php.example file to config.php:

cd gnusocial && mv config.php.example config.php

Now, open the config.php file and modify the following lines:

$config['site']['name'] = 'YOUR_SITE_NAME';
$db = new mysqli('localhost', 'USERNAME', 'PASSWORD', 'GNUSOCIAL_DB_NAME');

Replace YOUR_SITE_NAME with the name of your site, USERNAME with your PostgreSQL username, PASSWORD with your PostgreSQL password, and GNUSOCIAL_DB_NAME with the name of the PostgreSQL database you created earlier.

Initialize GNU Social Database

Finally, you need to initialize the GNU Social database. Navigate to the GNU Social directory and run the following scripts:

php scripts/install.php
php scripts/do_schema_updates.php

Conclusion

That's it! You have successfully installed GNU Social on Pop! OS. You can now access your GNU Social site by visiting the URL http://YOUR_DOMAIN_NAME/index.php.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!