Installing Friendica on Clear Linux

Friendica is a free and open-source social networking platform that allows you to create and join social networks. It is designed to be decentralized, and it supports all major social network protocols such as Diaspora, OStatus, and even more.

In this tutorial, you will learn how to install Friendica on Clear Linux which is an open source, rolling release Linux distribution.

Prerequisites

Before starting with the installation of Friendica, please make sure that you have the following prerequisites installed and configured on your Clear Linux machine:

Step 1: Install Apache Web Server and PHP

  1. From the terminal, update Clear Linux

    sudo swupd update
    
  2. Install Apache web server and PHP (7.2 or latest)

    sudo swupd bundle-add httpd php-basic
    
  3. Start the Apache web server and enable it to start on boot

    sudo systemctl start httpd.service
    sudo systemctl enable httpd.service
    
  4. Verify that Apache is running by visiting the following URL in your web browser

    http://localhost
    

    You should see a message stating "It works!".

Step 2: Install MariaDB

  1. Install MariaDB server

    sudo swupd bundle-add mariadb
    
  2. Start the MariaDB server and enable it to start on boot

    sudo systemctl start mariadb.service
    sudo systemctl enable mariadb.service
    
  3. Secure the MariaDB installation, set the root password, and remove the anonymous users

    sudo mysql_secure_installation
    
  4. Create a new MariaDB database and user for Friendica

    sudo mysql -u root -p
    CREATE DATABASE friendica;
    GRANT ALL PRIVILEGES ON friendica.* TO 'friendicauser'@'localhost' IDENTIFIED BY 'NewPassword';
    FLUSH PRIVILEGES;
    EXIT;
    

    Replace 'NewPassword' with a strong password of your choice.

Step 3: Download and Configure Friendica

  1. From the terminal, switch to the root user and navigate to the document root directory of the Apache web server

    sudo su
    cd /var/www/html/
    
  2. Download the latest stable release of Friendica from the official website

    sudo wget -O friendica.zip https://github.com/friendica/friendica/archive/2022.01.zip
    sudo unzip friendica.zip
    

    Please note that in the above command, we are downloading the 2022.01 branch. You may replace this with the latest stable version.

  3. Rename the extracted folder to "friendica" and adjust the permissions

    mv friendica-* friendica
    chown -R apache:apache friendica
    
  4. Copy the sample configuration files to the correct locations

    cd friendica
    cp .htconfig.php.sample .htconfig.php
    cp config/addon.config.php.sample config/addon.config.php
    
  5. Configure the .htconfig.php file

    nano .htconfig.php
    
    • Enter the database credentials that you created in Step 2:

      $db_host = 'localhost';
      $db_user = 'friendicauser';
      $db_pass = 'NewPassword';
      $db_data = 'friendica';
      
    • Set your site URL

      $a->config['system']['url'] = 'http://localhost/friendica';
      

    Save and close the .htconfig.php file.

  6. Restart the Apache web server

    sudo systemctl restart httpd.service
    

Step 4: Complete the Installation

  1. Open a web browser and enter the URL of your Friendica installation

    http://localhost/friendica
    

    The installation wizard should start. Follow the on-screen instructions to complete the installation.

  2. Once the installation is complete, log in to your Friendica admin panel by adding /admin to the end of the URL

    http://localhost/friendica/admin
    

    Use the admin account details entered during the installation to log in.

  3. To add new users to your Friendica instance, use the registration link shown in the admin panel.

Congratulations, you have successfully installed Friendica on Clear Linux.

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!

Alternatively, for the best virtual desktop, try Shells!