How to Install Friendica on macOS

Friendica is a free and decentralized social networking platform that allows users to connect and communicate with their friends and family. If you're looking to install Friendica on macOS, then you've come to the right place.

In this tutorial, we'll take you through the basic steps of installing Friendica on macOS.

Prerequisites

Before we start, please make sure that you have the following prerequisites:

Step 1: Download Friendica

You can download Friendica from the official website at https://friendi.ca/. Once the download is complete, extract the contents of the file to a directory of your choice.

Step 2: Configure the Web Server

Friendica is typically installed on a web server. So, you need to configure the web server on your macOS to host Friendica.

Configure Apache

By default, macOS comes pre-installed with Apache. Follow the below steps to configure Apache with PHP:

  1. Open the Terminal app on your macOS.

  2. Type the following command to open the Apache configuration file in nano editor:

    sudo nano /etc/apache2/httpd.conf
    
  3. Uncomment the following line by removing the #:

    LoadModule php7_module libexec/apache2/libphp7.so
    
  4. Save and exit the editor by pressing Control + X, Y, then Enter.

  5. Restart the Apache server by entering the following command:

    sudo apachectl -k restart
    

Configure Nginx

If you prefer to use Nginx instead of Apache, you can follow the below steps to install and configure Nginx:

  1. Open the Terminal app on your macOS.

  2. Install Nginx on macOS using Homebrew by executing the following command:

    brew install nginx
    
  3. Edit the Nginx configuration file using nano editor:

    sudo nano /usr/local/etc/nginx/nginx.conf
    
  4. Change the server section to the following:

    server {
      listen       80;
      server_name  localhost;
    
      location / {
          root   /Users/YourUserName/friendica;
          index  index.php;
    
          try_files $uri $uri/ /index.php;
      }
    
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
          root   html;
      }
    
      location ~ \.php$ {
          root           /Users/YourUserName/friendica;
          fastcgi_pass   127.0.0.1:9000;
          fastcgi_index  index.php;
          fastcgi_param  SCRIPT_FILENAME $request_filename;
          include        fastcgi_params;
      }
    }
    
  5. Save and exit the editor by pressing Control + X, Y, then Enter.

  6. Start the Nginx server by entering the following command:

    sudo nginx
    

Step 3: Configure the MariaDB/MySQL/PostgreSQL

Friendica requires a database server to store its data. You can either use MariaDB, MySQL or PostgreSQL as your database server.

Install MariaDB on macOS

Follow the below steps to install MariaDB on macOS using Homebrew:

  1. Open the Terminal app on your macOS.

  2. Enter the following command to install MariaDB:

    brew install mariadb
    
  3. Start the MariaDB server by entering the following command:

    mysql.server start
    
  4. Secure the installation by running the following command and following the prompts:

    mysql_secure_installation
    

Install MySQL on macOS

Follow the below steps to install MySQL on macOS using Homebrew:

  1. Open the Terminal app on your macOS.

  2. Enter the following command to install MySQL:

    brew install mysql
    
  3. Start the MySQL server by entering the following command:

    mysql.server start
    
  4. Secure the installation by running the following command and following the prompts:

    mysql_secure_installation
    

Install PostgreSQL on macOS

Follow the below steps to install PostgreSQL on macOS using Homebrew:

  1. Open the Terminal app on your macOS.

  2. Enter the following command to install PostgreSQL:

    brew install postgresql
    
  3. Start the PostgreSQL server by entering the following command:

    brew services start postgresql
    
  4. Create a new database by entering the following command:

    createdb your_database_name
    

Step 4: Configuration

Now that you have installed web server and database, it is time to configure Friendica.

  1. Rename the .htconfig.php.sample file to .htconfig.php.

  2. Edit the .htconfig.php file you just renamed and provide the following details:

Step 5: Launch the Friendica website

  1. Open your browser and type localhost in the URL bar.
  2. You will see the Friendica home page.
  3. Follow the on-screen prompts to set up your new Friendica instance.

That's it! You have successfully installed and configured Friendica on macOS. Enjoy your new social network platform!

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!