en
How to Host WordPress on an Offshore VPS
Self-hosting WordPress on an offshore VPS gives you complete control over your content, data, and server configuration. Unlike managed WordPress hosting, you choose every component, can install any plugin without restrictions, and pay a fraction of the cost at scale. This guide covers a production-grade LEMP stack setup for WordPress on an offshore server.
Need this done for your project?
We implement, you ship. Async, documented, done in days.
Installing the LEMP Stack (Nginx, PHP-FPM, MariaDB)
WordPress requires a web server, PHP, and a database. The LEMP stack (Linux, Nginx, MariaDB, PHP) is the modern recommended combination for performance. Install all components in one command on Debian/Ubuntu: `apt install -y nginx mariadb-server php-fpm php-mysql php-xml php-mbstring php-curl php-zip php-gd php-imagick php-intl`. Enable and start all services: `systemctl enable --now nginx mariadb php8.2-fpm` (adjust version to match your installed PHP).
Secure MariaDB with `mysql_secure_installation`. This script sets the root password, removes anonymous users, disables remote root login, and drops the test database. After securing, create a dedicated database and user for WordPress: log in with `mysql -u root -p`, then run `CREATE DATABASE wordpress; CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'strong-password'; GRANT ALL ON wordpress.* TO 'wpuser'@'localhost'; FLUSH PRIVILEGES;`. Never use the database root user in your application.
Configure PHP-FPM for WordPress. Edit `/etc/php/8.2/fpm/php.ini` and set: `upload_max_filesize = 64M`, `post_max_size = 64M`, `max_execution_time = 300`, `memory_limit = 256M`. These values allow WordPress to handle plugin installation, theme uploads, and image processing without timing out. Restart PHP-FPM after changes: `systemctl restart php8.2-fpm`.
Configuring Nginx for WordPress
Create an Nginx server block for your WordPress site at `/etc/nginx/sites-available/wordpress.conf`. The WordPress-specific Nginx configuration requires several non-obvious directives. The `try_files` directive in the root location must be `try_files $uri $uri/ /index.php?$args` - without this, WordPress pretty permalinks return 404 errors.
Add the PHP-FPM pass in a `location ~ \.php$` block: `fastcgi_pass unix:/var/run/php/php8.2-fpm.sock`, `include fastcgi_params`, `fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name`. Include the `fastcgi_intercept_errors on` and `fastcgi_read_timeout 300` directives to handle long-running operations like plugin bulk updates.
Deny access to sensitive WordPress files and directories. Add location blocks that return 403 for `wp-config.php`, `xmlrpc.php` (unless you need it), and directories like `.git` and `wp-includes`. The `xmlrpc.php` endpoint is a frequent DDoS amplification target - block it unless you specifically need XML-RPC for Jetpack or similar. Block PHP execution inside the uploads directory: `location ~* /wp-content/uploads/.*\.php { deny all; }` prevents malicious PHP files uploaded via vulnerable plugins from executing.
WordPress Installation and Essential Configuration
Download WordPress to your document root. Navigate to `/var/www/wordpress` and run `curl -O https://wordpress.org/latest.tar.gz && tar -xzf latest.tar.gz --strip-components=1 && rm latest.tar.gz`. Set correct ownership: `chown -R www-data:www-data /var/www/wordpress` and permissions: `find /var/www/wordpress -type d -exec chmod 755 {} ; && find /var/www/wordpress -type f -exec chmod 644 {} ;`.
Copy the sample config: `cp wp-config-sample.php wp-config.php`. Edit it to add your database credentials. Also replace the placeholder authentication keys and salts with values generated from `https://api.wordpress.org/secret-key/1.1/salt/`. These keys secure login cookies and should be unique to each installation. Add `define('DISALLOW_FILE_EDIT', true);` to prevent plugin/theme editing via the admin panel - a security measure that stops attackers from using the editor as a backdoor.
Complete installation via the browser at your domain. Choose a strong admin password - WordPress admin accounts are targeted by credential stuffing attacks. After installation, install a security plugin like Wordfence for malware scanning and login protection. Configure automatic updates for WordPress core and security-only updates for plugins. On an offshore VPS you have the flexibility to configure any plugin or hosting behavior without provider restrictions.
Related Services
Why Anubiz Host
100% async — no calls, no meetings
Delivered in days, not weeks
Full documentation included
Production-grade from day one
Security-first approach
Post-delivery support included
Ready to get started?
Skip the research. Tell us what you need, and we'll scope it, implement it, and hand it back — fully documented and production-ready.