How to Install Friendica Social Network Platform on Ubuntu 20.04

Friendica is a free, open-source and decentralized social networking platform that helps you to build and maintain your own social networking projects. It has built-in support for ActivityPub including, Mastodon, Hubzilla, OStatus, Pleroma and more. It allows you to import your websites and blogs into your social stream via RSS/Atom feeds. It provides a powerful user and admin dashboard that helps you to manage your social network from any device.

In this tutorial, we will show you how to install Friendica with Apache and Let's Encrypt SSL on Ubuntu 20.04.


  • A server running Ubuntu 20.04.
  • A valid domain name pointed with your server IP.
  • A root password is configured the server.

Getting Started

Before starting, you will need to update your system packages to the latest version. You can update them using the following command:

apt-get update -y

Once your server is updated, you can proceed to the next step.

Install LAMP Server

Friendica runs on webserver, written in PHP and uses MySQL as a database backend. So the LAMP stack must be installed in your system. If not installed, you can install it with the following command:

apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-gmp php-curl php-intl php-mbstring php-xmlrpc php-mysql php-gd php-imagick php-xml php-cli php-zip php-sqlite3 curl git -y

Once all the packages are installed, edit the php.ini file and make some changes:

nano /etc/php/7.4/apache2/php.ini

Change the following lines:

memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 300
max_input_vars = 1500
date.timezone = Asia/Kolkata

Save and close the file when you are finished.

Create a Friendica Database

Next, you will need to create a database and user for Friendica. First, connect to the MySQL with the following command:


Once connected, create a database and user with the following command:

MariaDB [(none)]> CREATE DATABASE friendicadb;
MariaDB [(none)]> CREATE USER 'friendica'@'localhost' IDENTIFIED BY 'password';

Next, grant all the privileges to the Friendica database with the following command:

MariaDB [(none)]> GRANT ALL ON friendicadb.* TO 'friendica'@'localhost' WITH GRANT OPTION;

Next, flush the privileges and exit from the MySQL with the following command:

MariaDB [(none)]> EXIT;

Once you are finished, you can proceed to the next step.

Download Friendica

Before downloading Friendica, you will need to install Composer in your system. You can install it with the following command:

apt-get install composer -y

Once installed, change the directory to Apache web root and download the latest version of Friendica from the Git repository:

cd /var/www/html
git clone

Once the download is completed, change the directory to friendica and install the required PHP dependencies with the following command:

cd friendica
composer install --no-dev

Next, download the Friendica addons with the following command:

git clone

Next, set proper ownership and permission to the friendica directory:

chown -R www-data:www-data /var/www/html/friendica/
chmod -R 755 /var/www/html/friendica/

Once you are finished, you can proceed to the next step.

Configure Apache for Friendica

Next, you will need to create an Apache virtual host configuration file to host Friendica. You can create it with the following command:

nano /etc/apache2/sites-available/friendica.conf

Add the following lines:

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/html/friendica

     <Directory /var/www/html/friendica/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined


Save and close the file then enable the Apache virtual host and rewrite module with the following command:

a2ensite friendica.conf
a2enmod rewrite

Next, reload the Apache service to apply the changes:

systemctl restart apache2

You can verify the status of the Apache service with the following command:

systemctl status apache2

You should get the following output:

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2021-02-07 09:20:58 UTC; 6s ago
    Process: 33243 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 33259 (apache2)
      Tasks: 6 (limit: 2353)
     Memory: 15.1M
     CGroup: /system.slice/apache2.service
             ??33259 /usr/sbin/apache2 -k start
             ??33260 /usr/sbin/apache2 -k start
             ??33261 /usr/sbin/apache2 -k start
             ??33262 /usr/sbin/apache2 -k start
             ??33263 /usr/sbin/apache2 -k start
             ??33264 /usr/sbin/apache2 -k start

Feb 07 09:20:58 ubuntu2004 systemd[1]: Starting The Apache HTTP Server...

Access Friendica Dashboard

Now, open your web browser and access the Friendica web interface using the URL You will be redirected to the system check page:

Friendica system check

Make sure all the PHP dependencies are installed then click on the Next button. You should see the following page:

Server setup

Provide your domain name, installation path and click on the Submit button. You should see the following page:

Database connection

Provide your database name, database username, password and click on the Submit. You should see the Site setting page:

Site Settings

Provide administrator email, language, time zone and click on the Submit button. Once the installation has been completed, you should see the following page:

Installation Finished

Now, click on the registration page button and finish the registration process to access the Friendica.

Secure Friendica with Let's Encrypt SSL

It is always a good idea to secure your website with Let's Encrypt SSL. You will need to install the Certbot client to install and manage the SSL. You can install it with the following command:

apt-get install python3-certbot-apache -y

Once the Certbot is installed, run the following command to secure your website with Let's Encrypt SSL:

certbot --apache -d

You will be asked to provide your email and accept the term of service as shown below:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): [email protected]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at You must
agree in order to register with the ACME server at
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/friendica-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/friendica-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/friendica-le-ssl.conf

Next, select whether or not to redirect HTTP traffic to HTTPS as shown below:

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

Type 2 and hit Enter to install the Let's Encrypt SSL for your website:

Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/friendica.conf to ssl vhost in /etc/apache2/sites-available/friendica-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled

You should test your configuration at:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 - Congratulations! Your certificate and chain have been saved at:
   Your key file has been saved at:
   Your cert will expire on 2020-10-23. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:
   Donating to EFF:          

Now, you can access your website securely using the URL


Congratulations! you have successfully installed and configured Friendica social network platform on Ubuntu 20.04 server. You can now manage your social network community from the central location.

Share this page:

7 Comment(s)

Add comment

Please register in our forum first to comment.


By: Martin Prous

When I try to browse to there is an error... it says the URL "" is not found and it's true... there is no "install" in the root directory of Friendica (directory or script).


By: Gabriel de Oliveira Estevam


Were you able to access a url below?

By: Tecoberg

I execute with sucess until the step 'Configure Apache for Friendica'.The apache was already secured (ssl) and the default page (index.html) and the info.php(<?php phpinfo(); ?>) page work fine, but I can't access the friendica from my browser.Also I try to change the line <VirutalHost *:80> to <VirtualHost*.443>, but still without sucess and the message 'Not Found. the requested URL was not found on this server.' persists.I checked the site to try to find some clue but nothing. There, the friendica's instalation is more obscure.

I don't know what I need to do to fixed it.


By: Gabriel de Oliveira Estevam

Guys, I’m following the tutorial and I came across the following problem in the last step. I don’t know how to get to the domain. I set up my friendica.conf file just like the tutorial. I give the commands after that, restart in apache2, but when I try to access:



Show this:

"Cannot access this site Check for a typo.



By: Keith Miller

I tried to goto the site and got Not found

The Requested URL was not found on this server

By: keith

I followed the instructions exactly and get the following error

Any help would be awesome



By: Aleksandr

Thanks to the author for such a good manual. The only thing, I will add some outdated points, which you may encounter when installing a new Friendica instance:

1. Issue and install an SSL certificate BEFORE installing Friendica via the web interface. Otherwise, your page will have Mixed Content and the entire layout on the page will break. 

2. If you install apache as a web server, as the author does, then you MUST change the name in the directory /friendica from .htaccess-dist to .htaccess

Otherwise, your instance will not start. 

3. After you clone the addon branch, you will need to rename the friendica-addons directory to addon. Otherwise, you will not see these addons in the Friendica admin panel.