How to Install OpenSIPS Web Control Panel On Ubuntu 15

April 11, 2016 | By
| 5 Replies More

OpenSIPS-CP is a Web Control Panel Application for OpenSIPS SIP server and users provisioning. It has the new graphical user interface for the SIP proxy. It was designed to be the primary tool to provision parameters for the OpenSIPS modules in the database. OpenSIPS-CP is developed using PHP that is usual for the VoIP providers to develop their own interface with the end users.

In this article we will show you the step-by-step instructions to install OpenSIPS-CP on Ubuntu 15 using the LAMP (Linux Apache MySQL PHP) stack.

Step 1: LAMP Setup

Login to your Ubuntu 15 server and prepare it for installation of LAMP Stack packages. So, our first step is to install the required packages including Apache2, MySQL and PHP with its required dependencies. Let's run the following command using your root user to install Apache2, PHP and its required modules.

# apt-get install apache2 php5 php5-cli php5-mysql php5-xmlrpc php-pear php-mdb2-driver-mysql php-log

You will be asked to type your desired as 'Y' to continue and 'n' to skip. So, Once you type in the 'Y' your installation of packages will starts.

installing Apache2

Install the MySQL database server if you do not have it already installed on your system. Just run the following command and the configure your root password when asked during the installation.

# apt-get instal mysql-server

Once your installation is complete for the Apach2 and MySQL and make sure to restart its services and confirm its status that both services should be running and enabled to start at Boot.

# systemctl restart mysql

# systemctl restart apache2

# systemctl status mysql
# systemctl status apache2

Apache Mysql services

Step 2: Download opensips-CP

Follow the link to Download the OpenSIPS-CP Package from here.

OpenSIPS-CP download

You can also download its package using the 'wget' command if its install on your system following by the link to download the OpenSIP-CP package.

root@ubuntu-15:~# cd /usr/src/opensips-2.1.2/

# wget -c "" -O opensips-cp_6.1.tgz

Now you have successfully downloaded OpenSIPS-CP package, run the following command to extract within the same directory using the following command.

# tar -zxf opensips-cp_6.1.tgz

download and untar

Step 3: Apache Web Configurations

Now we need to move web configurations into their particular directories and assign them the right ownerships.
To do so run the following commands accordingly.

# mkdir -p /var/www/cp

# cp -rR web config /var/www/cp/

# chown www-data:www-data -R /var/www/cp

Copying Web Data

Now add the configuration below into one of Apache's existent VHOSTs or create a new one, but we are going to use the default configuration to put the following code at the end of its configuration file using the 'vim' editor.

# vim /etc/apache2/apache2.conf

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order deny,allow
deny from all
Alias /cp /var/www/cp/web

apche2 Conf

Save and quit the file using ':wq!' .

Step 4: MySQL Database Configurations

In this step we are going to Setup a new database for opensips-cp using the MySQL server and import the opensips-cp schema.

# mysql -u root -p

mysql> create database opensips character set utf8;

mysql> exit

Change your directory to move into the opensips directory.

root@ubuntu-15:~# cd /usr/src/opensips-2.1.2/6.1

root@ubuntu-15:/usr/src/opensips-2.1.2/6.1# ls config/tools/admin/add_admin/

root@ubuntu-15:/usr/src/opensips-2.1.2/6.1# mysql -uroot -p opensips < config/tools/admin/add_admin/ocp_admin_privileges.mysql

# echo "INSERT INTO ocp_admin_privileges (username,password,ha1,available_tools,permissions) values ('admin','admin',md5('admin:admin'),'all','all');" | mysql -uroot -p opensips


Step 5: OpenSIPS-CP Database Connection

Now update '' to suit your database server setups using your command line editor under the following path as shown in the command.

# vim /var/www/cp/config/

//database driver mysql or pgsql
$config->db_driver = "mysql";

//database host
$config->db_host = "localhost";

//database port - leave empty for default
$config->db_port = "";

//database connection user
$config->db_user = "root";

//database connection password
$config->db_pass = "******";

//database name
$config->db_name = "opensips";

Save and Close the file and setting up your configurations. By default opensips-cp will save subscriber password in plain text, we have to change this because we don't want th password in plain text format. To do so let's edit '' and update value of '$config->passwd_mode' from 0 to 1. Value 1 will make opensips-cp calculate hash ha1 and ha1b, and save it in database as shown.

# vim /var/www/cp/config/tools/users/user_management/

//Password can be saved in plain text mode by setting $config->passwd_mode to 0 or chyphered mode, by setting it to 1

Few more configurations are stored in every 'inc' files in '/var/www/cp/config' directory and its sub-directories. Here the configuration of boxes determines how the OpenSIPS-CP will communicate with OpenSIPS. For example you can configure Mi box to access the OpenSIPS Mi interface. This can be through RPC protocol, FIFO, UDP, or JSON. So, you might need to edit '' to suit our server installations.

# vim /var/www/cp/config/

Opensips-cp db connection

Step 6: Access OpnSIP Web CP

When you have active state of both web and database services, then we are good to go on the browser to flow the following link to login by using the default user name and password that is 'admin' 'admin'.


Opensips-CP Login

Upon successful credentials you will be directed towards the OpenSIPs Control panel where you can start exploring its features choosing the options from the drop menu under the 'Admin', 'Users' and 'System' tabs.

OpenSIPS Control Panel


In this article you have learned the installation of OpenSIPS Web control Panel using the LAMP stack on Ubuntu 15 server. Let's start using it as per your needs and explore its awesome features using OpenSIPS CP graphical user interface. So, this will guide you through the process of doing a quick installation of OpenSIPS and OpenSIPS Control Panel, and will show you what you have to do in order to get a fully functional platform with reference to our previous article on How to Install OpenSIPS Server on Ubuntu 15.04. Thank you for reading will back to you with more interested articles.


Free Linux Ebook to Download

Comments (5)

Trackback URL | Comments RSS Feed

  1. Hein Tonny Køien says:


    Can you confirm that the step below is correct. My out-of-box Apache2 installation do not accept this configuration at the bottom of apache2.conf.

    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order deny,allow
    deny from all

    Alias /cp /var/www/cp/web

    • Kashif S says:

      Hi Hein Tonny,

      Sorry for the Delay, I have just attached an image under Apache2 Configurations.
      You need to put these configurations within the starting and closing the Directorytags as shown in the image that I have just attached under Apache Configurations.

      Thank you.

  2. MrDoe says:

    Just to say, since PHP7 no more includes mysql but mysqli, it's a pain to install opensips-cp

  3. Hello!
    Follow step by step, but do not load a login page, such as an attached image.
    What happened?
    Thank you so much
    Excellent job

  4. Ali says:


    Its very helpful to follow articles for newbie and the way you attached snapshots is also appreciated.

    Actually I installed following all instruction in this article but an error occurred at login which is shared below:

    Error while connecting : MDB2 Error: connect failed

    Please help on this.


Leave a Reply

Commenting Policy:
Promotion of your products ? Comment gets deleted.
All comments are subject to moderation.