It’s easy to create a website on a hosting. You’ve a got a nice control panel, Softaculous, website builder and other tools. But on a VPS or a server it’s a little more complicated.

Table of Contents

How to change the DNS records

DNS records show the browsers on which server they should look for the website’s files when the user types in a domain. If your domain is registered at Unihost:

  • Log into the Client Area.
  • Press Domains > Edit the DNS records.
  • Click Edit records.
  • Type your server’s IP address as an A-record.
  • Click Save at the bottom of the page.

If you purchased the domain from another provider, write to their tech support and ask them to change the DNS records. IMPORTANT: The process of changing the DNS records can take up to 3 days. You can wait until it’s done, but I prefer to keep setting
up the server using its IP address.

How to make a website on a server with a control panel

All Unihost servers and VPS have an ISPmanager control panel installed. In order to log into it, access the address http://server’s_ip_address:1500 and type in the login and password that you received in the e-mail after purchasing the server. The just follow the manuals from the the ISPManager 5 chapter. For example, install the CMS via Softaculous.

How to make a website on a server without a control panel

If you have no control panel, or you just really want to setup everything through the console, you are going to need:

Starting work

  • Open the terminal on your PC or another device (Ctrl+Alt+T or use the app menu).
  • Connect to the server. To do this, run the following command: ssh user_name@server’s_ip_address and enter your password if necessary.

How to install and setup the necessary software

In order to run a website from the VPS or a server, you need a LAMP. LAMP is a software complex that consists of Linux OS (L), Apache webserver (A), MySQL database manager (M) and hypertext preprocessor PHP (P). I also recommend adding PHPMyAdmin — a
web interface for MySQL, which makes setting up databases much easier. You already have Linux installed on your server, so let’s install the rest.


Necessary to transmit files via HTTP, which means necessary for the server to work at all.

  • Install Apache with: sudo apt install apache2.
    DS_171017_873a65 (1)
  • Enter your password, in order to give the terminal root access.
  • Press Y and Enter, to confirm installation.
  • Wait until it’s done.
  • Go to the http://your_server’s_ip_address and see the Apache test page.

Database manager

Databases are necessary in modern CMS. They contain all the custom information about the website — user list, post content etc.

  • Install the MySQL with: sudo apt install mysql-server.
  • Press Y and Enter to confirm installation.
  • Make up a password for MySQL. You can type in anything you want, even «1234» — we are going to change it later anyway.
  • Confirm the password.
  • Wait until the installation is over.
  • Run /usr/bin/mysql_secure_installation to set MySQL up.
  • Enter your OS password.
  • Agree to install the password validation plugin. To do this, press Y on the keyboard and press Enter.
  • Plugin offers three strength levels for your password. Type in the one you want and press Enter.

    • Plugin will evaluate the current password on a 1-100 scale and offer to change it. Agree by pressing Y and Enter.
    • Type in a new password. It has to conform to the guidelines you agreed to previously.
    • Plugin will re-evaluate your password and offer to continue. Press Y and Enter.
    • Respond to all following requests by pressing Y and Enter. This will delete all the test databases, test users and close some vulnerabilities in MySQL itself.
    • Wait until setup is over.

Hypertext preprocessor

PHP is necessary to run scripts — special programs that are necessary for all modern CMS to function.

  • Install PHP: sudo apt install php libapache2-mod-php php-mcrypt php-mysql.
  • Press Y and Enter, to confirm installation.
  • Wait until it’s done.
  • Create a test php file by running: sudo nano /var/www/html/info.php
  • Paste this into it:
    • Press Ctrl+X, to close the text editor.
    • Press Y, to save the changes.
    • Press Enter to overwrite the file.
    • Check whether PHP is working or not. To do this, go to http://your_server’s_ip_address/info.php и and see the PHP test page.

MySQL web interface

You can manage databases in the terminal, but it’s not really convenient. If you have a web interface, you can do straight in the browser, in a more cozy and traditional way.

  • Install PHPMyAdmin: sudo apt install phpmyadmin apache2-utils.
  • Press Y and Enter, to confirm installation.
  • In the list of web servers, select apachе2 and press Enter.
  • When asked whether or not configure the database with db-common, choose Yes and press Enter.
  • Enter your MySQL password and press Enter.
  • Enter it again and press Enter once more.
  • Wait until the installation is over. DS_171017_d0233e
  • Open the Apache settings file: sudo nano /etc/phpmyadmin/apache.confDS_171017_c28394
  • Find the line DirectoryIndex index.php.
    Paste AllowOverride All under it. You should have:

    <Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php
    AllowOverride All
  • Press Ctrl+X to close the editor.
  • Press Y to save changes.
  • Press Enter to confirm the file overwrite.
  • Open the Apache config file: sudo nano /etc/apache2/apache2.conf
  • Add at the end of the file:
    # Include phpmyadmin configurations:
    Include /etc/phpmyadmin/apache.confDS_171017_577052
  • Press Ctrl+X to close the editor.
  • Press Y to save changes.
  • Press Enter to confirm the file overwrite.
  • Reboot Apache: sudo service apache2 restart

Go to http://server’s_ip_address/phpmyadmin and see the phpMyAdmin login page.

How to upload the website files to the server

Once the web server is setup and working, you can upload the website’s files into it. For example, the WordPress installation files.

  • Download the files to your computer and unpack them to /home/admin/Downloads/Wordpress or any other folder.
  • Upload them to the server via SFTP. To do this, install the SFTP-client called FileZilla.
    • On Ubuntu, open the terminal and run sudo apt install filezilla.
    • On Windows , download the installer from the official website and run it.
  • Now unlock the SFTP to the folder you want to upload the website files to. To do this, run this in the terminal: sudo chown имя_пользователя:имя_пользователя /var/www/html and
    sudo chmod -R 775 /var/www
  • Launch FileZilla. At the top of the screen, there’s a Quickconnect panel:
    • Under Host enter sftp://your_server’s_ip.
    • Under Username enter your Linux username on the server.
    • Under Password enter your password on the server.
    • Under Port enter 22.
    • Press Quickconnect and connect to the server.
    • In the Remote site field (on the right) type in /var/www/html and press Enter.
    • Right click on the index.html and click Delete. Confirm the deletion by clicking Yes. It’s an Apache test file and it must be deleted to prevent conflicts.
    • In the Local site field (on the left) type in the address of the folder where your website’s files are located.
    • Select all files in the folder on the left and drag them to the folder on the right. The process will take around 10 minutes. Maybe more, if you have a lot of small files.
    • Once the Queued files table has no more files, you can close FileZilla.

Now you can go to http://your_server’s_ip_address and check your CMS installation webpage. But you should not install it just yet, because you do not have a database.

How to create a database

  • Go to http://your_server’s_ip_address/phpmyadmin.
    DS_171017_d9c9c5 (1)
  • Enter your MySQL password and click Go.
  • In the menu to the left, click New.
  • Create a name for the database and click Create.

How to install WordPress (or any other CMS)

  • Go to http://your_server’s_ip_address.
    DS_171017_6cb4bb (1)
  • In case of WordPress, click Let’s Go! and fill in the necessary data, like the database access one. Afterwards, click Submit.
  • WordPress wants for the user to create the file wp-config.php with the certain contents.
  • Create it in gEdit, and upload to the web server with FileZilla.
  • Go back to the WordPress installer and Run the install.
  • Fill in the website name, user name, e-mail and password, afterwards click Install WordPress.
  • Once the install is over, you can log into your website and start using it.
  • Now you can run your website on the VPS just as you did on your usual hosting. Except for much better performance.