Hosting WordPress Yourself? Here’s Why I Moved off Paid Hosting

WordPress Migration

Migrate your WordPress website to Proxmox and use CloudFlare for DNS management


1. Create LXC container in Proxmox

For this step, you can use the community script:
🔗 https://community-scripts.github.io/ProxmoxVE/scripts?id=wordpress

2. Install the LXC container following the guide

Once installed, access WordPress using the link provided.

3. Follow the WordPress setup process

Install and configure WordPress using the built-in installer. Log in with the credentials you provided.

4. Install the All-in-One WP Migration Plugin

Use it to import your previously exported WordPress website.
👉 This plugin is fantastic—it even retains MFA settings.


5. Configure DNS with Cloudflare

6. Add your domain

In the CloudFlare dashboard, click “Add Domain” and input your existing domain.

7. Replace current nameservers

Cloudflare will provide nameservers. Replace your current ones with those.

Note: If your domain is with OVH (like mine), go to:
Domain names → DNS Servers → Modify DNS Servers
Replace the OVH default servers with the ones from Cloudflare.

⚠️ DNS propagation can take up to 24 hours, but it’s usually faster.

✅ Congrats! You can now manage DNS directly from the Cloudflare dashboard.


6. Setup CloudFlare Tunnel on LXC

Install cloudflared via repository (recommended)

For Debian Bookworm:

sudo mkdir -p –mode=0755 /usr/share/keyrings

curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg | sudo tee /usr/share/keyrings/cloudflare-main.gpg >/dev/null

echo ‘deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared bookworm main’ | sudo tee /etc/apt/sources.list.d/cloudflared.list

sudo apt-get update && sudo apt-get install cloudflared

Authenticate & Create Tunnel

cloudflared tunnel login

cloudflared tunnel create wp

Take note of the Tunnel UUID and credentials file.


7. Configure cloudflared

Create the config file at /etc/cloudflared/config.yml:

tunnel: <TUNNEL_ID>

credentials-file: /root/.cloudflared/<TUNNEL_ID>.json

ingress:

 – hostname: onlydevops.pl

   service: http://localhost:80

 – service: http_status:404

Route the DNS via Cloudflare:

cloudflared tunnel route dns wp onlydevops.pl

Enable cloudflared as a system service:

sudo cloudflared service install

systemctl status cloudflared


8. WordPress + Apache Tweaks

Adjust wp-config.php

Add:

define(‘WP_HOME’, ‘https://onlydevops.pl’);

define(‘WP_SITEURL’, ‘https://onlydevops.pl’);

if ($_SERVER[‘HTTP_X_FORWARDED_PROTO’] == ‘https’) {

   $_SERVER[‘HTTPS’] = ‘on’;

}

Adjust Apache Config

Edit /etc/apache2/sites-available/wordpress.conf and set:

ServerName onlydevops.pl


9. Enable URL Rewriting

Run:

a2enmod rewrite

systemctl restart apache2

This is necessary for “pretty” URLs like:

✅ https://yourdomain.com/about
❌ https://yourdomain.com/index.php?page_id=2

WordPress uses .htaccess with rules that depend on mod_rewrite. Without it, subpages may break with 404 errors.


🔧 Useful cloudflared Troubleshooting Commands

cloudflared tunnel list

cloudflared tunnel info

Scroll to Top