Migrating from WordPress.com to Self-Hosted VPS is a common requirement for VPS administrators. This guide provides practical instructions that you can follow on Ubuntu 22.04/24.04 or Debian 12, though most steps apply to other distributions as well.
Prerequisites
- Root or sudo access to the server
- A VPS running Ubuntu 22.04 or later (2GB+ RAM recommended)
- Basic familiarity with the Linux command line
- A web server with PHP (if applicable)
Installation Guide
The wordpress configuration requires careful attention to resource limits and security settings. On a VPS with limited resources, it's important to tune these parameters according to your available RAM and CPU cores.
# Install dependencies for CMS
sudo apt update
sudo apt install -y nginx mysql-server php-fpm php-mysql php-xml php-mbstring php-curl php-gd
# Download and install
cd /var/www
sudo wget https://example.com/wordpress-latest.tar.gz
sudo tar xzf wordpress-latest.tar.gz
sudo chown -R www-data:www-data /var/www/wordpress
The output should show the service running without errors. If you see any warning messages, address them before proceeding to the next step.
Advanced Settings
If you encounter issues during setup, check the system logs first. Most problems can be diagnosed by examining the output of journalctl or the application-specific log files in /var/log/.
Database Configuration
Regular maintenance is essential for keeping your wordpress installation running smoothly. Schedule periodic reviews of log files, disk usage, and security updates to prevent issues before they occur.
# Create database for the CMS
sudo mysql -e "CREATE DATABASE wordpress_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
sudo mysql -e "CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'secure_password';"
sudo mysql -e "GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wordpress'@'localhost';"
sudo mysql -e "FLUSH PRIVILEGES;"
The configuration above sets the recommended values for a VPS with 2-4GB of RAM. Adjust the memory-related settings proportionally if your server has different specifications.
Security Implications
The migration component plays a crucial role in the overall architecture. Understanding how it interacts with wordpress will help you make better configuration decisions.
- Keep all software components up to date
- Use strong, unique passwords for all services
- Enable firewall and allow only necessary ports
- Use SSH keys instead of password authentication
- Set up fail2ban for brute force protection
Theme and Plugin Setup
When scaling this setup, consider vertical scaling (adding more RAM/CPU) first, as it's simpler to implement. Horizontal scaling adds complexity but may be necessary for high-traffic applications.
# Install dependencies for CMS
sudo apt update
sudo apt install -y nginx mysql-server php-fpm php-mysql php-xml php-mbstring php-curl php-gd
# Download and install
cd /var/www
sudo wget https://example.com/wordpress-latest.tar.gz
sudo tar xzf wordpress-latest.tar.gz
sudo chown -R www-data:www-data /var/www/wordpress
This configuration provides a good balance between performance and resource usage. For high-traffic scenarios, you may need to increase the limits further.
Common Issues and Solutions
- Connection timeout: Verify your firewall rules allow traffic on the required ports. Use
ss -tlnpto confirm the service is listening on the expected port. - Permission denied errors: Ensure files and directories have the correct ownership. Use
chown -Rto fix ownership andchmodfor permissions. - High memory usage: Review the configuration for memory-related settings. Reduce worker counts or buffer sizes if running on a low-RAM VPS.
Wrapping Up
Following this guide, your wordpress setup should be production-ready. Keep an eye on resource usage as your traffic grows and don't forget to test your backup and recovery procedures periodically.