Friendica is a free, decentralized social networking platform that allows you to communicate with your friends without being dependent on any single company.
In this tutorial, we'll show you how to install Friendica on Elementary OS.
Before we begin, make sure that you have the following:
Friendica requires a web server to run, so the first step is to install Nginx and PHP on your machine.
sudo apt update
sudo apt install nginx
sudo apt-get install php7.4-fpm php7.4-curl php7.4-gd php7.4-intl php7.4-mbstring php7.4-mysql php7.4-xml
sudo systemctl restart nginx
Friendica requires MariaDB database to store the data. The following steps will guide you through the installation process.
sudo apt-get install mariadb-server mariadb-client
sudo systemctl start mariadb
sudo mysql_secure_installation
In this step, we will create a new database and user account for Friendica.
sudo mysql -u root -p
Enter the root password when prompted.
Type the following command to create a new database:
CREATE DATABASE friendica_db;
GRANT ALL PRIVILEGES ON friendica_db.* TO 'friendica_user'@'localhost' IDENTIFIED BY 'password';
Note: Replace 'password' with a strong password.
exit;
cd /var/www/html
sudo git clone https://github.com/friendica/friendica.git
sudo chown -R www-data:www-data friendica/
In this step, you will create a new Nginx server block for Friendica.
sudo nano /etc/nginx/sites-available/friendica
server {
listen 80;
server_name yourdomain.com;
root /var/www/html/friendica;
index index.php index.html;
access_log /var/log/nginx/friendica_access.log;
error_log /var/log/nginx/friendica_error.log;
# PHP-FPM Configuration
location ~ \.php$ {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
# Static files caching
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
}
# Rewrite URLs for Friendica
location / {
try_files $uri $uri/ /index.php?$args;
}
}
Note: Replace 'yourdomain.com' with your own domain name.
Save the changes and exit the text editor by pressing 'CTRL + X' and then typing 'Y' and 'Enter'.
Type the following command to enable the friendica server block:
sudo ln -s /etc/nginx/sites-available/friendica /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
Open your web browser and go to http://yourdomain.com (replace 'yourdomain.com' with your own domain name).
Follow the installation prompts by filling in the required details.
When prompted for the database details, enter the following:
Continue with the installation and complete the setup.
Congratulations! You have successfully installed Friendica on Elementary OS. You can now start using Friendica to communicate with your friends and family in a decentralized way!
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!