How to Install HumHub on NixOS Latest

HumHub is a free, open-source social networking platform, similar to Facebook in terms of functionality. In this tutorial, we will show you how to install HumHub on NixOS Latest.

Prerequisites

Before installing, make sure you have the following prerequisites:

Step 1: Update Nix Package Manager

Make sure your Nix package manager is up-to-date by running the following command:

sudo nix-channel --update

Step 2: Installing Required Packages

In order to install HumHub, you need the following packages:

Install these packages by entering the following command:

sudo nix-env -iA nixos.php mysql nginx

Step 3: Create a Database for HumHub

Next, log in to your MySQL server using the following command:

mysql -u root -p

Once you are logged in, create a new database for HumHub using the following MySQL command:

CREATE DATABASE humhub;

Step 4: Download and Install HumHub

In this step, we will download and install HumHub. First, create a new directory for HumHub:

sudo mkdir /var/www/humhub

Then go to that directory using the following command:

cd /var/www/humhub

Now, download the latest version of HumHub using the following command:

sudo wget https://www.humhub.org/download/package/humhub-latest.tar.gz

Extract the downloaded file using the following command:

sudo tar -xvf humhub-latest.tar.gz

Change the ownership of the directory to the Nginx user using the following command:

sudo chown -R nginx:nginx /var/www/humhub

Step 5: Configure Nginx Server Block

In order to configure Nginx for HumHub, you need to create a new Nginx server block. To do this, create a new file with the .conf extension in the following directory:

sudo nano /etc/nginx/conf.d/humhub.conf

and add the following configuration:

server {
    listen 80;
    server_name humhub.example.com;

    root /var/www/humhub;

    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
        fastcgi_intercept_errors on;
    }
}

Save the file and exit the editor.

Step 6: Start Nginx and PHP-FPM Service

Finally, start the Nginx and PHP-FPM service using the following command:

sudo systemctl start nginx
sudo systemctl start php-fpm

You can also enable these services to start automatically at boot time using the following commands:

sudo systemctl enable nginx
sudo systemctl enable php-fpm

Step 7: Configure HumHub

Open your web browser and enter the following URL:

http://humhub.example.com/

Follow the on-screen instructions to complete the installation process.

Congratulations! You have successfully installed HumHub on NixOS Latest.

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!