How to Install Friendica on OpenSUSE Latest

Friendica is an open-source social networking platform that supports multiple social networks, including Twitter, Facebook, and Diaspora. In this tutorial, we will explain how to install Friendica on the latest version of OpenSUSE.

Prerequisites

Before we proceed with the installation, make sure you have the following prerequisites already installed:

Step 1: Install Apache Web Server

To install the Apache web server, open the terminal and run the following command:

sudo zypper in apache2

Once the installation is complete, start the Apache web server using the following command:

sudo systemctl start apache2

Enable the Apache web server to start at boot time using the following command:

sudo systemctl enable apache2

Step 2: Install PHP

Friendica requires PHP 7.4 or higher to run. To install PHP 7.4 on OpenSUSE, run the following commands:

sudo zypper in php74 php74-mysql php74-mbstring php74-gd php74-zip php74-ldap

Once the installation is complete, restart the Apache web server to apply the changes using the following command:

sudo systemctl restart apache2

Step 3: Install MariaDB

Friendica requires a database server to store its data. In this tutorial, we will use MariaDB as our database server. To install MariaDB on OpenSUSE, run the following command:

sudo zypper in mariadb mariadb-client

Once the installation is complete, start the MariaDB server using the following command:

sudo systemctl start mysql

Enable the MariaDB server to start at boot time using the following command:

sudo systemctl enable mysql

Step 4: Create a Database and User for Friendica

Before we proceed with the Friendica installation, we need to create a database and a user for Friendica in the MariaDB server. Follow the steps below to create a database and user:

  1. Log in to the MariaDB server using the following command:

    sudo mysql -u root -p
    
  2. Enter the root user's password when prompted.

  3. Create a new database and user for Friendica using the following commands:

    CREATE DATABASE friendica;
    CREATE USER 'friendicauser'@'localhost' IDENTIFIED BY 'your_password';
    GRANT ALL PRIVILEGES ON friendica.* TO 'friendicauser'@'localhost' WITH GRANT OPTION;
    FLUSH PRIVILEGES;
    

    Replace your_password with a strong password.

  4. Exit the MariaDB server using the following command:

    exit
    

Step 5: Install Composer

Friendica uses Composer as its package manager. To install Composer on OpenSUSE, run the following command:

sudo zypper in composer

Step 6: Download and Install Friendica

To download and install Friendica on OpenSUSE, follow the steps below:

  1. Open the terminal and navigate to the /srv/www/htdocs/ directory using the following command:

    cd /srv/www/htdocs/
    
  2. Download the Friendica package using the following command:

    git clone https://github.com/friendica/friendica.git
    
  3. Navigate to the Friendica directory using the following command:

    cd friendica
    
  4. Install the required dependencies using Composer using the following command:

    composer install
    
  5. Copy the config/local.config.php.sample file to config/local.config.php using the following command:

    cp config/local.config.php.sample config/local.config.php
    
  6. Edit the config/local.config.php file and replace the following lines:

    // Database configuration
    $db_type = "";
    $db_host = "";
    $db_port = "";
    $db_name = "";
    $db_user = "";
    $db_pass = "";
    

    With:

    // Database configuration
    $db_type = "mysql";
    $db_host = "localhost";
    $db_port = "3306";
    $db_name = "friendica";
    $db_user = "friendicauser";
    $db_pass = "your_password";
    

    Use the database credentials created in step 4 to replace friendicauser and your_password.

  7. Change the ownership of the Friendica directory to the Apache web server user using the following command:

    sudo chown -R wwwrun:www /srv/www/htdocs/friendica
    

Step 7: Configure Apache for Friendica

To configure Apache for Friendica, create a new virtual host configuration file using the following command:

sudo nano /etc/apache2/vhosts.d/friendica.conf

Add the following content to the file:

<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /srv/www/htdocs/friendica
    ServerName example.com
    ErrorLog /var/log/apache2/friendica_error_log
    CustomLog /var/log/apache2/friendica_access_log common
    DirectoryIndex index.php
    <Directory /srv/www/htdocs/friendica>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Replace example.com with your domain name. Also, make sure to create an A record for your domain name to point to your server IP address.

Save and close the file.

Restart the Apache web server using the following command:

sudo systemctl restart apache2

Step 8: Access Friendica

You can now access your Friendica installation by opening a web browser and navigating to your domain name.

Congratulations! You have successfully installed Friendica on OpenSUSE.

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!