Friendica is a free and open-source social networking platform that allows users to connect with their friends across the internet. In this tutorial, we will guide you through the installation process of Friendica on Debian 11.
Before you start, ensure that you have the following:
Updating and Upgrading Debian
It is always advisable to update and upgrade your system before proceeding to install any software. Use the following commands to update and upgrade your Debian system:
sudo apt update
sudo apt upgrade
Before installing Friendica, we need to install required dependencies. Run the following command to install them:
sudo apt install apache2 mariadb-server php libapache2-mod-php7.4 php-pear php-mysql php-curl php-json php-xml php-mbstring php-zip php-gd
Visit the following page to download the latest Friendica version:
https://friendi.ca/download/
Extract the downloaded archive to the desired directory:
cd /var/www/html
sudo tar zxvf friendica_full_x.x.x.tar.gz
(where x.x.x is the version number)
Rename the friendica directory:
sudo mv friendica_full_x.x.x friendica
Set up the permissions of the Friendica directory:
sudo chown -R www-data:www-data /var/www/html/friendica/
Friendica requires a database to store its data. Run the following command to log in to the MySQL command line as the root user:
sudo mysql -u root -p
Create a new database and user for Friendica:
CREATE DATABASE friendica;
CREATE USER 'friendica'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON friendica.* TO 'friendica'@'localhost';
FLUSH PRIVILEGES;
Replace 'password' in the above command with a secure password.
Run the following command to enable the Apache rewrite module:
sudo a2enmod rewrite
Create a new Apache virtual host configuration file by running command:
sudo nano /etc/apache2/sites-available/friendica.conf
Add the following lines in the file:
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/friendica
ServerName your_domain.com
ServerAlias www.your_domain.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/friendica>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =your_domain.com [OR]
RewriteCond %{SERVER_NAME} =www.your_domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
Replace your_domain.com
with your actual domain name.
Save the file and exit.
To make this virtual host configuration active, run:
sudo a2ensite friendica.conf
Reload the Apache service:
sudo systemctl reload apache2
Open your web browser and go to http://your_domain.com/install.php
.
Configure the following settings:
http://your_domain.com
(replace with your actual domain name)/var/www/html/friendica
(default)Click on the "Install Friendica" button.
After the installation is complete, delete the install.php
file:
sudo rm /var/www/html/friendica/install.php
Congratulations! You have successfully installed Friendica on your Debian 11 server. You can now create your account and start using Friendica.
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!