How to install WordPress on Digital Ocean VPS Hosting


In the world of website creation and management, WordPress remains a powerful and popular platform. If you’re looking to set up a WordPress website on a DigitalOcean Virtual Private Server (VPS), you’re in the right place. This step-by-step guide will walk you through the process of installing WordPress on DigitalOcean VPS hosting.


Step 1: Set Up a DigitalOcean Account

1. Visit the DigitalOcean website ( and sign up for an account.

2. Once registered, log in to your account and access the DigitalOcean Control Panel.


Step 2: Create a Droplet (VPS)

1. Click on the “Create Droplet” button.

2. Choose the desired settings for your VPS, including server size, data center region, and operating system (e.g., Ubuntu).

3. Add your SSH keys for secure access.

4. Click “Create Droplet” to deploy your VPS.


Step 3: Connect to Your VPS via SSH

1. Open your terminal and type: `ssh root@your_vps_ip_address`.

2. Enter your password when prompted to establish a secure connection.


Step 4: Set Up LAMP Stack

1. Update your server’s package list: `sudo apt update`.

2. Install Apache: `sudo apt install apache2`.

3. Install MySQL: `sudo apt install mysql-server`.

4. Secure your MySQL installation: `sudo mysql_secure_installation`.

5. Install PHP: `sudo apt install php libapache2-mod-php php-mysql`.


Step 5: Create a MySQL Database

1. Log in to MySQL: `sudo mysql -u root -p`.

2. Create a new database: `CREATE DATABASE wordpressdb;`.

3. Create a new user: `CREATE USER ‘wordpressuser’@’localhost’ IDENTIFIED BY ‘your_password’;`.

4. Grant privileges: `GRANT ALL ON wordpressdb.* TO ‘wordpressuser’@’localhost’;`.

5. Flush privileges and exit: `FLUSH PRIVILEGES; EXIT;`.


Step 6: Install WordPress

1. Download WordPress: `wget`.

2. Extract the archive: `tar -xzvf latest.tar.gz`.

3. Move WordPress files: `sudo mv wordpress/* /var/www/html/`.

4. Configure permissions: `sudo chown -R www-data: /var/www/html/`.

5. Rename the sample configuration file: `mv /var/www/html/wp-config-sample.php /var/www/html/wp-config.php`.


Step 7: Configure WordPress

1. Open the WordPress configuration file: `sudo nano /var/www/html/wp-config.php`.

2. Replace database name, user, and password with your MySQL details.

3. Save and exit the file.


Step 8: Complete Installation

1. Open your web browser and navigate to your VPS IP address.

2. Select your preferred language and complete the WordPress installation wizard.



Congratulations! You’ve successfully installed WordPress on your DigitalOcean VPS hosting. By following this guide, you’ve taken a significant step towards creating and managing your own website. Remember, WordPress offers a multitude of themes, plugins, and customization options to make your site unique and engaging. Happy website building!