FB pixel

Installing a Website on a VDS

1 21.07.2025

A VDS (Virtual Dedicated Server) is a virtual dedicated server that provides users with a fully isolated space for hosting a website or application. It is a more powerful and flexible solution than regular hosting. On a VDS, you can control the server and install any software. How do you deploy a website on a VDS? To do this, you need to complete several basic configurations.

Preparing the VDS

Before installing a website, you need to prepare your server. Here’s what you need to do:

ssh root@IP_address_of_your_server

apt update && apt upgrade -y

adduser your_username
usermod -aG sudo your_username

ufw allow OpenSSH
ufw enable

  1. Choose an Operating System. A VDS supports various operating systems, including Windows and macOS, but the most popular servers are Linux distributions such as Ubuntu, CentOS, and Debian. If you are unsure which one to choose, start with Ubuntu.
  2. Connect to the Server. After purchasing a VDS, you will receive access credentials (IP address, login, and password). Use the terminal of your Linux system to connect to the server using the SSH command:
  3. Update the System. After connecting, enter the following command:
  4. Create a New User. Working under the root account is unsafe, so create a separate user:
  5. Configure the Firewall. This will protect your server from unauthorized access. Activate the UFW firewall, which is a convenient tool for managing incoming and outgoing connections on the server, using the command:

Now, your server is ready for further work.

Installing the LAMP Stack

To function on the website, you must install the LAMP stack (“Linux, Apache, MySQL, PHP”), which is ideal for most projects. The commands listed below should also be entered using the terminal.

1. Install Apache

Apache is a web server that processes user requests and delivers website pages. It is widely used due to its reliability and flexibility.

sudo apt install apache2

After installation, enter your server's IP address in a browser. If the installation was successful, you will see the default Apache page.

2. Install MySQL

MySQL is a database management system that stores all vital website information, such as user accounts, page content, and other data.

sudo apt install mysql-server
sudo mysql_secure_installation

This command will install MySQL and configure its security. After running it, you will be prompted to set a password for the database administrator (root). Enter a strong password. If the password prompt does not appear automatically, run the command sudo mysql_secure_installation and follow the system instructions.

3. Install PHP

PHP is a programming language that allows your website to perform dynamic functions, such as processing forms or interacting with the database. It integrates with Apache and MySQL, creating a powerful tool for web applications.

sudo apt install php libapache2-mod-php php-mysql

To verify that PHP is working, create a test file info.php in the /var/www/html directory:

echo "" > /var/www/html/info.php

Open http://IP_address/info.php in a browser to confirm that PHP is configured correctly.

Manually Installing a Website on a VDS

After preparing the server, the next step is to install your website. This process includes uploading website files, setting up the database, and configuring the web server.

1. Uploading Website Files

Your website files should be uploaded to the server in the web server directory, usually /var/www/html. To transfer files, you can use SCP (Secure Copy Protocol) or SFTP (for example, via FileZilla).

For SCP, execute the command:

scp -r /path_to_local_files username@IP_address:/var/www/html/

For SFTP, open FileZilla, connect to the server using the IP address, login, and password, and then drag the website files into the appropriate directory.

2. Creating a Database

Create a database in MySQL if your website uses a database (e.g., WordPress, Joomla). Follow these steps:

mysql -u root -p

CREATE DATABASE database_name;

GRANT ALL ON database_name.* TO 'username'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT;

  1. Log into MySQL:
  2. Create a database:
  3. Create a user and assign permissions:

Write down the database name, username, and password. These credentials will be needed for website configuration.

3. Configuring Apache

To ensure the website functions correctly, create a new virtual host:

sudo nano /etc/apache2/sites-available/your_website.conf

ServerName your_domain

DocumentRoot /var/www/html/your_website

AllowOverride All

 

ErrorLog ${APACHE_LOG_DIR}/error.log

CustomLog ${APACHE_LOG_DIR}/access.log combined

 

sudo a2ensite your_website
sudo systemctl restart apache2

  1. Create a configuration file:
  2. Example file content:
  3. Activate the new virtual host and restart Apache:

4. Checking Website Functionality

  1. Ensure your domain’s DNS records are configured correctly and point to your server’s IP address.
  2. Open your domain in a browser. If everything is set up correctly, you will see your website.

If errors occur, check Apache logs:

tail -f /var/log/apache2/error.log

Installation in ISPmanager

1. Logging into ISPmanager

  1. Open a browser and enter the address where the panel is accessible (e.g., https://your_IP:1500). Sometimes, the provider assigns a specific port or login address (e.g., https://your_domain/manager). Check with your provider if the details differ.
  2. Log in using the username and password provided by the hosting provider (or the credentials you set earlier).

2. Adding a Domain and Linking it to ISPmanager

  1. Go to the "Domains" → "WWW Domains" section.
  2. Click the "Create" button.
  3. Enter your domain (e.g., example.com). If you want the website to open at www.example.com, check the corresponding box (or specify ServerAlias).
  4. Select or create a user (the system will prompt you to choose an existing user or create a new one).
  5. Choose the PHP version.
  6. Specify the root directory of the website. By default, ISPmanager usually creates a directory like /var/www/username/data/www/example.com.
  7. Save the changes.

Important: Ensure your domain points to the server’s IP address (A-record in DNS). Otherwise, the website may not be accessible.

3. Managing Website Files

  1. In ISPmanager, go to "Files" → open the user's directory → the domain's directory (e.g., /var/www/username/data/www/example.com).
  2. Click "Upload" and select the archive/files of your website.
  3. Extract the archive (if you uploaded a .zip, .tar.gz, etc.) – the manager usually has an "Extract" button.

4. Creating a Database and User

If your website (e.g., CMS WordPress, OpenCart, or any other engine) uses a database, follow these steps:

  1. Go to "Databases" → "Create".
  2. Specify:
    • Database name (e.g., example_db);
    • User (choose an existing one or create a new one);
    • Password.
  3. Save the changes.

As a result, you will receive:

  • Database name (e.g., username_example_db, depending on ISPmanager settings);
  • Database username (e.g., username_dbuser);
  • Password for this user;
  • Server (usually localhost).

These details must be specified in your website's configuration (in the wp-config.php file for WordPress, config.php for other CMSs, etc.).

5. Website Configuration

  1. Upload the CMS files (e.g., WordPress) to the domain's root directory using the file manager or FTP.
  2. Open your domain in a browser (e.g., http://example.com).
  3. Follow the installation instructions (the CMS will prompt you to enter database details, site name, administrator login/password, etc.).
  4. After completing the installation, ensure that the website loads correctly.

6. SSL Certificate Setup (HTTPS)

To make your website accessible via HTTPS, install an SSL certificate. ISPmanager provides convenient tools for this.

  1. Go to "Domains" → "SSL Certificates" → "Add Certificate".
  2. Select "Let’s Encrypt" (a free certificate) or upload your own if you already have one.
  3. Enter the domain (and, if necessary, the subdomain www.example.com).
  4. Enter an email address (notifications will be sent there in case of validation issues).
  5. Save the settings and wait for the installation to complete.
  6. Check-in "WWW Domains" that SSL is enabled and the correct certificate is selected.

Learn more about how to purchase a domain, hosting, VPS, or dedicated server.

FAQ

When should you use a VDS?

A VDS should be used when more flexibility in configuring the server environment is required than shared hosting can offer. For example, it is suitable for hosting resource-intensive projects, demanding applications, or databases where stability and scalability are crucial.

What is the difference between VDS and VPS?

VDS (Virtual Dedicated Server) and VPS (Virtual Private Server) are often used interchangeably. Both refer to a virtual machine on a physical server. However, in some cases, VDS may imply a higher isolation level.

What VDS configuration should you choose?

The choice of configuration depends on your project's specific needs. Consider parameters such as the number of CPU cores, RAM size, and SSD storage capacity.