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:
- A valid and updated Clear Linux installation
- A web server with PHP 7.1 or later installed
- MySQL/MariaDB server
- A command-line interface (CLI)
Step 1: Install Apache Web Server and PHP
From the terminal, update Clear Linux
sudo swupd updateInstall Apache web server and PHP (7.2 or latest)
sudo swupd bundle-add httpd php-basicStart the Apache web server and enable it to start on boot
sudo systemctl start httpd.service sudo systemctl enable httpd.serviceVerify that Apache is running by visiting the following URL in your web browser
http://localhostYou should see a message stating "It works!".
Step 2: Install MariaDB
Install MariaDB server
sudo swupd bundle-add mariadbStart the MariaDB server and enable it to start on boot
sudo systemctl start mariadb.service sudo systemctl enable mariadb.serviceSecure the MariaDB installation, set the root password, and remove the anonymous users
sudo mysql_secure_installationCreate 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
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/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.zipPlease note that in the above command, we are downloading the
2022.01branch. You may replace this with the latest stable version.Rename the extracted folder to "friendica" and adjust the permissions
mv friendica-* friendica chown -R apache:apache friendicaCopy 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.phpConfigure the .htconfig.php file
nano .htconfig.phpEnter 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.
Restart the Apache web server
sudo systemctl restart httpd.service
Step 4: Complete the Installation
Open a web browser and enter the URL of your Friendica installation
http://localhost/friendicaThe installation wizard should start. Follow the on-screen instructions to complete the installation.
Once the installation is complete, log in to your Friendica admin panel by adding
/adminto the end of the URLhttp://localhost/friendica/adminUse the admin account details entered during the installation to log in.
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.