Friendica is a free and open-source social networking platform that allows users to manage and share their information on various social networking sites, including Facebook, Twitter, and others. In this tutorial, we will guide you through the steps to install Friendica on Void Linux.
Before we start with the installation process, we need to ensure that the following prerequisites are met:
To install Friendica on Void Linux, we need to first install some necessary packages. Open the Terminal window and run the following command to update package lists:
sudo xbps-install -S
Next, run the following command to install the required packages:
sudo xbps-install -y mariadb mariadb-client lighttpd php php-fpm php-mysqlnd php-gd php-mbstring php-curl
It will install the MariaDB database server, Lighttpd webserver, and some necessary PHP modules required for Friendica.
Composer is a PHP package manager that is used to manage dependencies in PHP applications. To install Composer, run the following command:
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
Once installed, check the version of Composer by running the following command:
composer -V
You should see the Composer version displayed if it has been installed successfully.
We need to create a new database and a user for Friendica to use. To do so, use the following commands to log in to the MariaDB server:
sudo mysql -u root
Now, create a new database for Friendica by running the following command:
CREATE DATABASE friendica_db;
Next, create a new user for Friendica and grant privileges to the newly created database:
CREATE USER 'friendica_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON friendica_db.* TO 'friendica_user'@'localhost';
FLUSH PRIVILEGES;
Ensure to replace the "password" with a secure password for the 'friendica_user' account.
To download and install Friendica, we need to run the following commands:
sudo mkdir /var/www && cd /var/www
sudo git clone https://github.com/friendica/friendica.git friendica
cd friendica
sudo -HEu www-data composer install
sudo cp .htaccess-dist .htaccess
sudo cp config/sample.config.php config/config.php
sudo chmod -R 777 view/theme/frio/cache/
sudo chmod -R 777 store/
In the above commands:
/var/www
and move to this directory.composer
..htaccess-dist
file to .htaccess
.config.php
.view/theme/frio/cache
and store
directories to 777
.To set up Friendica, we need to edit the config.php
file. For this, open the file using your text editor:
sudo nano /var/www/friendica/config/config.php
Scroll down to the database settings section, and update the following settings according to the database created in Step 3:
db_host
: Change it to 'localhost'.db_user
: Change it to 'friendica_user'.db_pass
: The password used for the 'friendica_user' account.db_data
: The name of the database, i.e., 'friendica_db'.Save and close the file by pressing Ctrl + X
, then Y
and press Enter
.
The default Lighttpd configuration file needs some changes to enable the Friendica application. Open the configuration file using the following command:
sudo nano /etc/lighttpd/lighttpd.conf
Add the following lines of configuration at the end of the file:
server.document-root = "/var/www/friendica"
server.error-handler-404 = "/index.php"
url.rewrite-if-not-file = (
"^/([^?]*)(\?(.*))?$" => "/dfrn_poll.php?fragment=$1&$3"
)
Save and close the file.
We need to restart the web server and PHP-FPM services to pick up the changes made. To restart these services, run the following commands:
sudo systemctl restart lighttpd.service
sudo systemctl restart php-fpm.service
Now, launch your web browser and go to http://your_server_IP_address
. If everything has been configured correctly, you should see the Friendica home page.
Enter your details to create a new account or use an existing account to log in and start using Friendica.
Congratulations! You have successfully installed Friendica on Void Linux.
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!