Install Open Source Social Network on Ubuntu 16.04

open source social network on ubuntuIn this tutorial, we are going to provide you with step by step instructions on how to install Open Source Social Network with Apache on an Ubuntu 16.04 VPS.
Open Source Social Network (OSSN) is a social networking software written in PHP used by website developers to create social networking websites. The installation process is easy and it takes only a couple of minutes.

At the time of writing this tutorial, the latest stable version of Open Source Social Network is 4.2 and it requires:

  • PHP 5.4 or higher (preferably the latest), compiled with cURL, mcrypt, MySQLi, ZIP, JSON, XML PHP extensions and GD PHP Library enabled.
  • allow_url_fopen option enabled in PHP
  • Apache Web Server 2.0 or higher compiled with mod_rewrite module;

This install guide assumes that Apache is already installed and configured on your virtual server.

Let’s start with the installation. Make sure your server OS packages are fully up-to-date:

apt-get update 
apt-get upgrade

Enable Apache rewrite module if it is not already done so:

a2enmod rewrite

Install required PHP packages:

apt-get install php7.0-cli php7.0-common php7.0-json php7.0-mcrypt php7.0-mysql php7.0-xml php7.0-curl php7.0-zip php7.0-gd

Restart the Apache service for the changes to take effect:

service apache2 restart

Download the latest version of Open Source Social Network available at to a directory on the server and extract it using the following commands:

cd /opt/
wget -O
unzip -d /var/www/html/

Create a new MySQL database and user for OSSN:

mysql -u root -p
mysql> SET GLOBAL sql_mode='';
mysql> CREATE DATABASE ossndb;
mysql> CREATE USER 'ossnuser'@'localhost' IDENTIFIED BY 'y0ur-pAssW0RD';
mysql> GRANT ALL PRIVILEGES ON ossndb.* TO 'ossnuser'@'localhost';
mysql> quit

Do not forget to replace ‘y0ur-pAssW0RD’ with a strong password.

Edit the PHP configuration file (/etc/php/7.0/cli/php.ini):

vi /etc/php/7.0/cli/php.ini

and modify these lines:

allow_url_fopen = On
file_uploads = On
upload_max_filesize = 32M

OSSN needs a directory for storing the uploaded files such as images. For security reasons we will create this directory outside of the document root directory:

mkdir -p /var/www/ossndatadir

All files have to be readable by the web server, so set a proper ownership:

chown www-data:www-data -R /var/www/html/ossn/

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘ossn.conf’ on your virtual server:

touch /etc/apache2/sites-available/ossn.conf
ln -s /etc/apache2/sites-available/ossn.conf /etc/apache2/sites-enabled/ossn.conf
vi /etc/apache2/sites-available/ossn.conf

Then, add the following lines:

<VirtualHost *:80>
DocumentRoot /var/www/html/ossn/
<Directory /var/www/html/ossn/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
ErrorLog /var/log/apache2/
CustomLog /var/log/apache2/ common

Remove the 000-default.conf file:

rm /etc/apache2/sites-enabled/000-default.conf

Restart the Apache web server for the changes to take effect:

service apache2 restart

Open your favorite web browser, navigate to , verify that all installation prerequisites are met and the OSSN installer should be starting. You should follow the easy instructions on the install screen inserting the necessary information as requested. Do not forget to set data directory to ‘/var/www/ossndatadir’.

That is it. The Open Source Social Network has been installed on your server.

Log in to the OSSN administration back-end at and configure OSSN according to your needs.

ossn back-end


Of course, you don’t have to do any of this if you use one of our OSSN VPS Hosting services, in which case you can simply ask our expert Linux admins to install Open Source Social Network for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.


Install Miniflux on Ubuntu 14.04
Install Kloxo-MR on a Linux VPS
SSH login without password using SSH keys
  • Hans


    Author Reply


    Thanks for this tutorial.
    Sadly I am using the free version and after some dabbling I saw that ossn doesn’t seem to detect mod_rewrite accurately, and there is no /administrator directory.

    • admin


      Author Reply

      Apache mod_rewrite is required for OSSN to work, so enable Apache rewrite module using:

      a2enmod rewrite