How to Install ZpanelX Web Hosting Control Panel on Ubuntu Server 12.04

Methods 2: Install Zpanelx manually

Step 1. Same as the first step in Method 1, Make sure you have all the latest security updates for Ubuntu Server 12.04 by running following commands

sudo apt-get update
sudo apt-get upgrade

Step 2. Disable and remove ApparMor daemon, run following commands

sudo /etc/init.d/apparmor stop
sudo update-rc.d -f apparmor remove
sudo apt-get remove apparmor
sudo shutdown -r now

Step 3. Download Zpanelx 10 for linux. Download it using wget command


Step 4. Extract zpanelx-master.tar.gz anywhere and run file

sudo tar -zxvf zpanelx-master.tar.gz
cd zpanel-master/etc/build
sudo chmod +x

Step 5. Now copy all file and folder in the directory zpanel-master into /etc/zpanel/panel

sudo cp -R ../../* /etc/zpanel/panel/

Step 6. Copy configuration file for ubuntu server 12.04 into directory /etc/zpanel/configs

sudo cp -R /etc/zpanel/panel/etc/build/config_packs/ubuntu_12_04/* /etc/zpanel/configs/

Step 7. Set permisson phpmyadmin configuration file (config.ic.php)

chmod 644 /etc/zpanel/panel/etc/apps/phpmyadmin/

Step 8. Install the base packages Apache,MySQL and PHP5

sudo apt-get install apache2 mysql-server libapache2-mod-php5 libapache2-mod-bw php5-common php5-suhosin php5-cli php5-mysql php5-gd php5-mcrypt php5-curl php-pear php5-imap php5-xmlrpc php5-xsl libdb4.8 zip webalizer

Step 9. Set up zpanelx database config and import zpanel database

sudo nano /etc/zpanel/panel/cnf/db.php
$host = "localhost";
$dbname = "zpanel_core";
$user = "root";
mysql -u root -p YOUR_ROOT_MYSQL_PASSWORD < /etc/zpanel/configs/zpanel_core.sql

Step 10. Configure Apache2 :

To add the ZPanel generated Apache2 config, we need to add the following line:-

edit /etc/apache2/apache2.conf

comment out:

#Include sites-enabled/

add at bottom:

Include /etc/zpanel/configs/apache/httpd.conf

Set ZPanel Network info and compile the default vhost.conf by running following commands

sudo /etc/zpanel/panel/bin/setso –set zpanel_domain CONTROLPANEL.YOURDOMAIN.COM

sudo /etc/zpanel/panel/bin/setso --set zpanel_domain preciseserver

sudo /etc/zpanel/panel/bin/setso –set server_ip YOUR_PUBLIC_IP_ADDRESS

sudo /etc/zpanel/panel/bin/setso --set server_ip
sudo php /etc/zpanel/panel/bin/daemon.php

Step 11. Install and configure postfix-dovecot

sudo apt-get install postfix postfix-mysql dovecot-mysql dovecot-imapd dovecot-pop3d dovecot-common libsasl2-modules-sql libsasl2-modules

sudo mkdir -p /var/zpanel/vmail
sudo chmod -R 777 /var/zpanel/vmail
sudo chmod -R g+s /var/zpanel/vmail
sudo groupadd -g 5000 vmail
sudo useradd -m -g vmail -u 5000 -d /var/zpanel/vmail -s /bin/bash vmail
sudo chown -R vmail.vmail /var/zpanel/vmail

mysql -u root -p YOUR_ROOT_MYSQL_PASSWORD < /etc/zpanel/configs/postfix/zpanel_postfix.sql

# Config Postfix

echo "# Dovecot LDA" >> /etc/postfix/
echo "dovecot unix - n n - - pipe" >> /etc/postfix/
echo ' flags=DRhu user=vmail:mail argv=/usr/lib/dovecot/deliver -d ${recipient}' >> /etc/postfix/

Edit the following file and add mysql root and password, you can use nano editor

  • sudo nano /etc/zpanel/configs/postfix/conf/dovecot-sql.conf
  • sudo nano/etc/zpanel/configs/postfix/conf/
  • sudo nano /etc/zpanel/configs/postfix/conf/
  • sudo nano /etc/zpanel/configs/postfix/conf/
  • sudo nano /etc/zpanel/configs/postfix/conf/
  • sudo nano /etc/zpanel/configs/postfix/conf/
  • sudo nano /etc/zpanel/configs/postfix/conf/
sudo mv /etc/postfix/ /etc/postfix/main.old
sudo ln /etc/zpanel/configs/postfix/conf/ /etc/postfix/
sudo mv /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.old
sudo ln -s /etc/zpanel/configs/dovecot2/dovecot.conf /etc/dovecot/dovecot.conf

Edit file /etc/zpanel/configs/postfix/conf/

myhostname = YOUR_DOMAIN
mydomain   = YOUR_DOMAIN

Reboot your computer

Step 12. Configure roundcube

mysql -u root -p YOUR_ROOT_MYSQL_PASSWORD < /etc/zpanel/configs/roundcube/zpanel_roundcube.sql

edit file /etc/zpanel/panel/etc/apps/webmail/config/

nano /etc/zpanel/panel/etc/apps/webmail/config/

Edit this line

$rcmail_config['db_dsnw'] = 'mysql://root:YOUR_ROOT_MYSQL_PASSWORD@localhost/zpanel_roundcube';

Step 13. Install and configure FTP server ProFTPD

sudo apt-get install proftpd-mod-mysql (When asked what mode, choose 'stand-alone')
mysql -uroot -pYOUR_ROOT_MYSQL_PASSWORD < /etc/zpanel/configs/proftpd/zpanel_proftpd.sql
sudo groupadd -g 2001 ftpgroup
sudo useradd -u 2001 -s /bin/false -d /bin/null -c "proftpd user" -g ftpgroup ftpuser

Edit /etc/zpanel/configs/proftpd/proftpd-mysql.conf, replace with your credentials:

You can use your MySQL root account if you wish or create a new restricted user account as you wish!

SQLConnectInfo zpanel_proftpd@localhost root your_root_password
sudo mv /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf.backup
sudo touch /etc/proftpd.conf
sudo echo "include /etc/zpanel/configs/proftpd/proftpd-mysql.conf" >> /etc/proftpd/proftpd.conf
sudo touch /var/zpanel/logs/proftpd
sudo chmod -R 644 /var/zpanel/logs/proftpd

Step 14. Install and Configure BIND DNS server

sudo apt-get install bind9 bind9utils
sudo mkdir /var/zpanel/logs/bind
sudo touch /var/zpanel/logs/bind/bind.log
sudo chmod -R 777 /var/zpanel/logs/bind/bind.log
sudo echo "include \"/etc/zpanel/configs/bind/etc/log.conf\";" >> /etc/bind/named.conf
sudo echo "include \"/etc/zpanel/configs/bind/etc/named.conf\";" >> /etc/bind/named.conf
sudo ln -s /usr/sbin/named-checkconf /usr/bin/named-checkconf
sudo ln -s /usr/sbin/named-checkzone /usr/bin/named-checkzone
sudo ln -s /usr/sbin/named-compilezone /usr/bin/named-compilezone

Step 15. Configure Zpanel Zsudo

Must be owned by root with 4777 permissions, or zsudo will not work!

sudo cc -o /etc/zpanel/panel/bin/zsudo /etc/zpanel/configs/bin/zsudo.c
sudo chown root /etc/zpanel/panel/bin/zsudo
sudo chmod +s /etc/zpanel/panel/bin/zsudo

Step 16. Configure the CRON job for the zdaemon

sudo touch /etc/cron.d/zdaemon
sudo echo "*/5 * * * * root /usr/bin/php -q /etc/zpanel/panel/bin/daemon.php >> /dev/null 2>&1" >> /etc/cron.d/zdaemon
sudo chmod 644 /etc/cron.d/zdaemon

Step 17. Registering the zppy client

sudo ln -s /etc/zpanel/panel/bin/zppy /usr/bin/zppy

Step 18. Reboot your computer, if your already turn on. access zpanel from computer on your network

Link Reference:

Tags: #Control Panel #Hosting #Ubuntu Server 12.04 #Web Hosting #Zpanelx

How to Upgrade Ubuntu Server 12.04 to Ubuntu Server 14.04 LTS
How to Upgrade Ubuntu Server 12.04 to Ubuntu Server 14.04 LTS
This tutorial will describes how to upgrade
How to Setup OwnCloud Server 5 with SSL Connection
How to Setup OwnCloud Server 5 with SSL Connection
Today ownCloud is the best cloud storage
  • Mohamed Nazar


    Thanks for the steps, I have successfully installed the zpanel, but I have a issue when i try to log in via webmail with the email ID and password I am unable to login into it. The error is “connection to IMAP server failed”

    How to solve it?


  • John

    Step 2: Link off -> {“error”: “Service Unavailable”}

  • Victor Iaros

    chmod: changing permissions of `': Operation not permitted

    • Izhar Aazmi

      use sudo chmod +x and provide password when requested. See if this works!

Must read×