How to install Open Source Social Network on Ubuntu Server 18.04?

Social Networks
Social Networks

Social networks are a current event. With them, it is possible to follow in real time everything. Thanks to Open Source Social Network (OSSN) you can create one on your own server in an easy and simple way. So, it is important to a company to have one.

Open Source Social Network emerges as a response to the many data security issues of the major companies behind the major social networks in the world. With a powerful but very intuitive web interface, it allows you to create your own social network.

So, let’s install it on Ubuntu Server 18.04.

1. Upgrade the system

Before starting the whole installation process, it is advisable to update the whole system. This ensures that you have the security patches installed on your computer.

:~$ sudo apt update && sudo apt upgrade
1. Upgrade the system
1. Upgrade the system

As I said before, with this you will have a more stable and safer system.

2. Install Apache web server

Open Source Social Network is a web-based solution. Therefore, it is necessary to install an HTTP web server to host it on a server. In this case, the chosen one will be apache for its simplicity of use.

:~$ sudo apt install apache2
2.- Installing Apache web server
2.- Installing Apache web server

Then, enable and start the service. Next, check the service status.

:~$ sudo systemctl enable apache2 
:~$ sudo systemctl start apache2
:~$ sudo systemctl status apache2
3.- Starting the apache web server service
3.- Starting the Apache web server service
4.- Apache service status
4.- Apache service status

Finally, open a web browser and go to HTTP://IP_SERVER. If you see something like this, apache is correctly installed.

5.- Apache default page
5.- Apache default page

It Works!!

3. Install PHP 7.1

Here’s a little problem. Ubuntu 18.04 comes with PHP 7.2 in its official repositories, however, Open Source Social Network does not support PHP 7.2. So, you have to install PHP 7.1 from an external repository. It’s not complicated, you’ll see.

:~$ sudo add-apt-repository ppa:ondrej/php
6.- Adding an external repository to install PHP 7.1
6.- Adding an external repository to install PHP 7.1

Then, install PHP 7.1

sudo apt install php7.1 php7.1-mysql php7.1-curl php7.1-json php7.1-cgi libapache2-mod-php7.1 php7.1-mcrypt php7.1-xmlrpc php7.1-gd php7.1-mbstring php7.1 php7.1-common php7.1-xmlrpc php7.1-soap php7.1-xml php7.1-intl php7.1-cli php7.1-ldap php7.1-zip php7.1-readline php7.1-imap php7.1-tidy php7.1-recode php7.1-sq php7.1-intl
7.- Installing PHP 7.1
7.- Installing PHP 7.1

Now you have to check that PHP is working properly with apache. Create a file named example.php in /var/www/html and add the following.

:~$ nano /var/www/html/example.php
8.- Creating a PHP file to test it
8.- Creating a PHP file to test it

Now, open your web browser and open it. HTTP://IP_SERVER/example.php if you see the PHP info, then, everything is OK.

9.- PHP info
9.- PHP info

4. Install MariaDB

Now you have to install and configure MariaDB as a database manager. This is the default Open Source Social Network. Fortunately, MariaDB is very popular and is available in the main repositories.

:~$ sudo apt install mariadb-server
10.- Installing MariaDB
10.- Installing MariaDB

Next, you have to secure the installation with mysql_secure_installation script. With that script, you can set a root password and other things more.

:~$ sudo mysql_secure_installation
11.- Using mysql_secure_installation script
11.- Using mysql_secure_installation script

As you can see, I answered the question that way: Y, N, Y, Y.

Next, you have to create a database and an user for Open Source Social Netwok.

:~$ sudo mysql -u root -p
USE ossndb;
GRANT ALL PRIVILEGES ON ossndb.* TO 'ossnuser'@'localhost' IDENTIFIED BY 'ossnpss';
12.- Creating the databse for Open Source Social Network
12.- Creating the database for Open Source Social Network

You can install Open Source Social Network.

5. Install Open Source Social Network

Finally, you can install it. First, download it.

:~$ cd /tmp/
:~$ wget
13.- Downloading the application
13.- Downloading the application

Then, decompress it.

:~$ unzip
14.- Decompressing the file
14.- Decompressing the file

The next step is to copy the folder to the Apache directory. Create a new folder for the application data and assign them writing permission.

:~$ sudo cp -r ossn /var/www/html/
:~$ sudo mkdir /var/www/html/ossn_data
:~$ sudo chown -R www-data:www-data /var/www/html/ossn/
:~$ sudo chmod -R 755 /var/www/html/ossn/
:~$ sudo chown -R www-data:www-data /var/www/html/ossn_data
15.- Setting folders permissions
15.- Setting folders permissions

Next, create a virtual host for Open Source Social Network.

:~$  sudo nano /etc/apache2/sites-available/ossn.conf

And add the following:

<VirtualHost *:80>
DocumentRoot /var/www/html/ossn
ServerName ossn.osradar.local

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

ErrorLog ${APACHE_LOG_DIR}/ossn_error.log
CustomLog ${APACHE_LOG_DIR}/ossn_access.log combined

16.- Creating a virtualhost for OSSN
16.- Creating a virtual host for OSSN

Then, enable it and enable the rewrite module. Finally, restart apache.

:~$ sudo a2ensite ossn.conf
:~$ sudo a2enmod rewrite
:~$ sudo systemctl restart apache2
17.- Enabling virtualhost
17.- Enabling virtual host

Next, edit your /etc/hosts.

:~$ sudo nano /etc/hosts

And add the configuration to access. In short, the IP address and the server name. www.ossn.osradar.local ossn.osradar.local

And that’s it. You can finish the installation from the web interface.

6. Completing the installation

Now, access from the web browser. In my case, the direction is: HTTP://ossn.osradar.local. In the next screen, you will see all the installation prerequisites. If all of them are in green color, then you can continue.

18.- All prerequisites complete
18.- All prerequisites complete

Next, you have to set the site settings. Add the database information previously configured.

19.- Database settings
19.- Database settings

Next, create the admin account.

20. Creating the admin account
20. Creating the admin account

If everything went right, you’ll see a screen like this.

21.- Everything is OK
21.- Everything is OK

Now, you can log in with your credentials.

22.- Login screen
22.- Login screen

And you will see the dashboard.

23.- Open Source Social Network dashboard
23.- Open Source Social Network dashboard

And now you can use the program.


The OSSN installation is not duplicated in Ubuntu 18.04 and can help you to create your own social network using a web interface in an easy and dynamic way.

Please share this article with your friends.



Please enter your comment!
Please enter your name here