Domain

How to Install and Configure VPS Hosting on Ubuntu

Introduction

Ubuntu VPS hosting is one of the most popular choices for developers, businesses, and website owners because of its stability, security, and flexibility.

Once your VPS server is active, you can host websites, applications, email services, databases, and much more.

This detailed guide explains how to install and configure a VPS server running Ubuntu for beginners.

What You Need Before Starting

  • An active VPS hosting account from HostPeppy
  • Your VPS IP address
  • Root username and password
  • SSH client software such as Terminal or PuTTY

Step 1: Connect to Your VPS Server

Open Terminal on Linux/macOS or PuTTY on Windows.

Use the following SSH command:

ssh root@your-server-ip

Replace your-server-ip with your actual VPS IP address.

Enter your root password when prompted.

Step 2: Update Ubuntu Packages

After login, update all installed packages using:

apt update && apt upgrade -y

This ensures your server has the latest security patches and software updates.

Step 3: Create a New User

For security reasons, avoid using the root account for daily activities.

Create a new user:

adduser hostpeppyuser

Grant sudo access:

usermod -aG sudo hostpeppyuser

Step 4: Configure Firewall

Ubuntu includes UFW firewall support.

Allow SSH connections:

ufw allow OpenSSH

Enable firewall:

ufw enable

Check firewall status:

ufw status

Step 5: Install Apache Web Server

Install Apache using:

apt install apache2 -y

After installation, start Apache:

systemctl start apache2

Enable Apache on boot:

systemctl enable apache2

Step 6: Install MySQL Database Server

Install MySQL:

apt install mysql-server -y

Secure MySQL installation:

mysql_secure_installation

Step 7: Install PHP

Install PHP and common modules:

apt install php libapache2-mod-php php-mysql -y

Verify PHP installation:

php -v

Step 8: Test Your VPS Website

Open your browser and visit:

http://your-server-ip

If Apache is installed correctly, you will see the Ubuntu Apache default page.

How to Check VPS Server Status

You can monitor your VPS server using:

htop

Install htop if needed:

apt install htop -y

Common VPS Problems and Fixes

1. SSH Connection Refused

Ensure port 22 is open in firewall settings.

2. Apache Not Starting

Check Apache status:

systemctl status apache2

3. Website Not Loading

Verify DNS settings and firewall configuration.

Benefits of VPS Hosting

  • Dedicated server resources
  • Better website performance
  • Full root access control
  • Enhanced security
  • Scalable hosting environment
  • Ideal for growing websites

Need Help?

If you need assistance configuring your VPS server, the HostPeppy technical support team is available 24/7.

We can help with server setup, optimization, migration, security, and troubleshooting.

Still need help?

Our support team is available 24/7 to assist you with any hosting questions.

Contact Support