Independent testing Updated April 2026 387 self-hosting guides 5 VPS providers tested

guide

How to Self-Host WordPress on DigitalOcean (2026 Guide)

Learn how to self-host WordPress on DigitalOcean with a step-by-step 2026 guide covering setup, configuration, and recommended specs for a smooth deployment.

How to Self-Host WordPress on DigitalOcean (2026 Guide)

Self-hosting WordPress on DigitalOcean is an efficient way to build and manage your website while maintaining full control over its environment. With plans starting at just $6/month, DigitalOcean provides a robust platform for developers and homelabbers who want to run open-source applications. In this guide, you will learn how to set up WordPress on DigitalOcean through a step-by-step process.

Step 1: Create a DigitalOcean Account

  1. Go to DigitalOcean and sign up. You may need to verify your email address.
  2. Once your account is verified, log in to the DigitalOcean control panel.

Step 2: Create a Droplet

A Droplet is a scalable virtual private server (VPS) that will host your WordPress site.

  1. Click on โ€œCreateโ€ and select โ€œDroplets.โ€
  2. Select the Distribution: Choose an Ubuntu version (e.g., Ubuntu 22.04).
  3. Choose a Plan: Here is a comparison of DigitalOcean with other VPS providers:
ProviderPrice (per month)MemorySSD DiskTransfer
DigitalOcean$61 GB25 GB1 TB
Contabo VPSโ‚ฌ5.994 GB200 GB2 TB
Hetzner Cloudโ‚ฌ4.152 GB20 GB20 TB
Vultr$61 GB30 GB1 TB
Linode (Akamai Cloud)$51 GB25 GB1 TB
  1. Choose a Data Center Region: Select a location close to your target audience for lower latency.
  2. Authentication: Opt for SSH keys for secure access. If you donโ€™t have any set up, you can follow DigitalOceanโ€™s guide to create them.
  3. Finalize the Droplet: Click on โ€œCreate Droplet.โ€

Step 3: Connect to Your Droplet

After your Droplet is created, connect through SSH.

ssh root@your_droplet_ip

Replace your_droplet_ip with your Dropletโ€™s IP address.

Step 4: Prepare the Server

Once connected, update and upgrade your system.

sudo apt update
sudo apt upgrade -y

Install essential packages:

sudo apt install nginx mysql-server php-fpm php-mysql

Step 5: Secure MySQL and Set Up Database

Run the following command to secure your MySQL installation:

sudo mysql_secure_installation

Create a database and user for WordPress:

sudo mysql -u root -p
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'strong_password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 6: Download and Configure WordPress

Download the latest WordPress package.

wget https://wordpress.org/latest.tar.gz
tar -xvzf latest.tar.gz

Move the WordPress files to the Nginx server root.

sudo mv wordpress/* /var/www/html/

Set the proper permissions:

sudo chown -R www-data:www-data /var/www/html/
sudo chmod -R 755 /var/www/html/

Step 7: Configure Nginx

Create a new Nginx server block.

sudo nano /etc/nginx/sites-available/wordpress

Add the following configuration:

server {
    listen 80;
    server_name your_droplet_ip;

    root /var/www/html;
    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}

Enable the configuration by linking it to the sites-enabled directory:

sudo ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/

Test the configuration:

sudo nginx -t

If there are no issues, restart Nginx:

sudo systemctl restart nginx

Step 8: Complete WordPress Setup

Open your web browser and navigate to http://your_droplet_ip. You will be guided through the WordPress installation process. Provide the database name, user, and password you created earlier.

FAQs

1. How much does it cost to self-host WordPress on DigitalOcean?

The basic plan for DigitalOcean starts at $6/month, which provides adequate resources for a small- to medium-sized WordPress site. Depending on your website traffic and performance needs, you can scale up your Droplet resources. Itโ€™s a flexible pricing model suitable for developers and homelabbers looking for budget-friendly options.

2. Can I use a Domain Name with My WordPress on DigitalOcean?

Yes, you can use a custom domain name with your WordPress site on DigitalOcean. Youโ€™ll need to register your domain with a domain registrar and point the DNS records to your Dropletโ€™s IP address. After that, you can configure Nginx to manage requests for your domain, fulfilling SSL requirements and enhancing security.

3. What are the benefits of self-hosting WordPress on a VPS like DigitalOcean?

Self-hosting WordPress on a VPS like DigitalOcean allows for greater control over your environment, resources, and configurations. Developers can customize settings to suit specific needs, ensuring optimized performance. Additionally, self-hosting enhances privacy since your data is not stored on third-party servers. Consider exploring the r/selfhosted subreddit for community-driven insights on self-hosting applications.

Conclusion

Self-hosting WordPress on DigitalOcean empowers developers and users with the flexibility and control needed for optimal performance. By following these practical steps, youโ€™re well on your way to running a successful WordPress site on a robust VPS. For a broader comparison of VPS providers, visit our full VPS comparison.