Install Open Source Social Network (OSSN) on Ubuntu 18.04


Open Source Social Network (OSSN) is a free and open source social networking software written in PHP. It is used to create your own social network website and build relationships with your members. Ossn can also be used to build different types of social apps like Private Intranets, Public Networks, and Community. OSSN comes with a powerful user and admin dashboard that can help you build and manage your content on every device. OSSN comes with lots of features including, Photos, Profile, Friends, Smileys, Search, Chat and much more.

In this tutorial, we will be going to learn how to install Open Source Social Network on Ubuntu 18.04 LTS server.


  • A server running Ubuntu 18.04 LTS
  • A non-root user with sudo privileges.

Install LAMP Server

OSSN runs on the web server, written in PHP and uses MariaDB for the database. So, you will need to install Apache, PHP, and MariaDB to your system. OSSN does not support PHP 7.2 yet, so we will install PHP 7.1 from Ondrej repository.

You can add the repository with the following command:

Once the repository is added, install Apache, MariaDB, PHP, and all required PHP libraries by running the following command:

Once all the packages are installed, start Apache and MariaDB service and enable them to start on boot time with the following command:

Configure Database

By default, MariaDB installation is not secured. You can secure it by running the following script:

Answer all the questions as shown below:

Once the MariaDB is secured, log in to MariaDB shell:

Enter your root password and press Enter, then create a database and user with the following command:

Next, grant privileges to the OSSN database with the following command:

Replace ‘password’ with a secure password in the above SQL command and note it down, we need it later during OSSN installation. Next, you will need to run the FLUSH PRIVILEGES command so that the privileges table will be reloaded by MySQL and we can use new credentia

Next, exit from the MariaDB console with the following command:

Install OSSN

First, download the latest version of the OSSN with the following command:

After downloading, unzip the downloaded file with the following command:

Next, copy the extracted directory to the Apache root directory, create a data directory for OSSN and give proper permissions with the following command:

Next, create an Apache configuration file for OSSN with the following command:

Add the following lines:

Replace the domain name with your own domain name. Save and close the file, then enable virtual host file and Apache rewrite module with the following command:

Finally, restart Apache to apply all the changes:

OSSN will try to access itself by HTTP on the server to check mod_rewrite, this requires that the domain which you use for the installation in the virtual host file /etc/apache2/sites-available/ossn.conf exists in DNS. If you are using a non-existing domain like I’ll do it here with, then this domain needs to be configured in the /etc/hosts file of the server like this:

the file should contain a line starting with the IP of the server, followed by the domain name. Example:

Save the hosts file. Otherwise, you will get an error “MOD_REWRITE REQUIRED”.

Access OSSN web installer

Open your web browser and type the URL You will be redirected to the following page:

All requirements are met

Make sure all the requirements are met. Then, click on the Next button. You should see the following page:

Enter database settings

Here, provide your Site name and Database details. Then, click on the Install button. You should see the following page:

Create an admin account

Here, provide your admin user credentials. Then, click on the Create button. Once the installation has been finished, you should see the following page:

OSSN installation finished

Now, click on the Finish button. You will be redirected to the OSSN log in screen as shown below:

Login as admin user

Now, provide your admin username and password. Then, click on the Login button. You should see the OSSN dashboard in the following page:

When you click on ‘view site’ in the menu, you will see the OSSN frontend.

OSSN Frontend view

OSSN has been successfully installed on Ubuntu 18.04 LTS.

Virtual machine image download of this tutorial

This tutorial is available as ready to use virtual machine image in ovf/ova format that is compatible with VMWare and Virtualbox. The virtual machine image uses the following login details:

SSH / Shell Login

Username: administrator
Password: howtoforge

This user has sudo rights.

OSSN Login

Username: admin
Password: howtoforge

MySQL Login

Username: root
Password: howtoforge


Username: ossn
Password: password

The IP of the VM is, it can be changed in the file /etc/netplan/01-netcfg.yaml. Please change all the above passwords to secure the virtual machine.