Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Yes—you can run WordPress and a Rails application on one VPS. Keep Rails behind its existing Ruby application-server upstream, then add WordPress in a separate Nginx server block with its own document root, PHP-FPM backend, database, hostname and TLS configuration. A dedicated hostname such as blog.example.com is the safest default because it keeps routing, cookies, rewrites and operational failures apart.

WordPress does not run on Rails or PostgreSQL. It needs PHP-FPM plus MySQL or MariaDB, while Rails can continue using its current Ruby runtime and database. The procedure below adds those components without replacing the Rails virtual host.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the finished setup looks like

Nginx remains the only public web server listening on ports 80 and 443. It chooses a backend by hostname and, where applicable, by path. Requests for the Rails hostname continue to the existing Rails application server. Requests for the WordPress hostname are served from a new document root; static files are returned by Nginx and PHP requests are sent to PHP-FPM.

Concern Rails application WordPress site
Public entry point Existing hostname and Nginx server block Prefer a new hostname such as blog.example.com
Application runtime Existing Ruby application server PHP-FPM
Files Existing release/current directory Separate directory such as /var/www/blog.example.com
Database Existing Rails database Dedicated MySQL or MariaDB database and user
URL rewrites Existing Rails rules Nginx try_files and server-level rules
Certificates Existing certificate automation Certificate covering the WordPress hostname and an HTTP-to-HTTPS redirect

Isolation is deliberate. A PHP mistake should not send traffic to Rails, a WordPress update should not alter the Rails release directory, and database credentials should not grant one application access to the other application’s data.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Requirements to verify before installation

Supported software versions

Current WordPress recommendations are PHP 8.3 or newer, MariaDB 10.11 or newer or MySQL 8.0 or newer, and HTTPS. These requirements change over time, so check the current WordPress requirements page and the packages supported by your VPS distribution immediately before installing. Do not assume that a PHP-FPM socket or package name from another distribution applies to your server.

Access and information

You need administrative shell access, a text editor, and either shell or FTP access for the installation files. Record the operating-system release, Nginx configuration layout, the Rails upstream address (Unix socket or localhost port), the Ruby application-server service, firewall policy, and the tool that currently renews Rails certificates.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Database compatibility

WordPress requires MySQL or MariaDB and does not support PostgreSQL as its database backend. Plan a new database and login for WordPress; never point the installer at the Rails database simply because it is already available.

Choose a hostname or a subdirectory

A dedicated hostname is the lower-risk design. DNS, Nginx routing, the document root, cookies and TLS can be managed independently, and Rails routes remain untouched. A subdirectory such as https://example.com/blog can work, but it combines two applications under one hostname and requires more careful Nginx rules because standalone Nginx has no Apache-style .htaccess layer.

Decision factor Dedicated hostname Subdirectory
Nginx configuration One clear WordPress server block Path-specific locations and rewrite handling inside the Rails host
Cookie and session scope Separate host scope by default Shared hostname; path scoping must be checked
Failure boundary WordPress errors normally stay on the blog host Incorrect rules can affect the main site
TLS Certificate must include the new hostname Uses the existing hostname certificate
Backups and restores Clear files and database boundary Files may sit beside Rails-managed content
Operational effort Usually simpler More testing and explicit rewrite administration

Step 1: Inventory the running Rails service

Do this before changing any configuration. Identify the active Nginx files, enabled-site mechanism, and the exact Rails upstream. It may be a Unix socket or a localhost port. Also note whether Nginx terminates TLS, where certificates are stored, and how reloads are performed.

  • Save a copy of the current Nginx configuration and the Rails server block.
  • Write down the Rails server_name, upstream name, socket or port, root or proxy settings, and any websocket or long-polling locations.
  • Check firewall rules so ports 80 and 443 remain reachable while database and PHP-FPM sockets stay private.
  • Confirm that you can roll back a new file without deleting or editing the Rails block.

Do not point a new WordPress root at a Rails current or release directory. WordPress files need their own ownership, update process and backup boundary.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 2: Point DNS to the VPS

Create an address record for the chosen hostname, for example blog.example.com, pointing to the VPS address. If the VPS has both IPv4 and IPv6, configure both only when Nginx and the firewall listen correctly on both. Wait for the record to resolve before requesting a certificate or testing the hostname.

Keep the Rails DNS records unchanged. A DNS mistake can make the new hostname appear to work while the original site is actually receiving the request, so verify the resolved address and the hostname shown in the browser before proceeding.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Step 3: Install and verify PHP-FPM

Install a PHP release supported by the current WordPress requirements and by your distribution. Add PHP-FPM and the extensions required by the WordPress package and the plugins you intend to use. Package names differ between distributions; use the distribution’s supported packages rather than copying a command for a different release.

Find the real FPM socket

After installation, identify the active PHP-FPM Unix socket from the service configuration or the runtime directory. The path can vary by operating system and PHP version. The Nginx fastcgi_pass directive must use that exact path. A copied example such as /run/php/php-fpm.sock may be wrong on your VPS.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the service before involving Nginx

  • Confirm the PHP-FPM service is enabled and running.
  • Confirm the socket exists and is readable by the Nginx worker account.
  • Check the PHP-FPM log for startup or extension errors.
  • Record the service name and socket path for future upgrades; PHP version changes often change the path.

Do not send PHP requests to the Rails upstream. Rails does not interpret PHP files, and doing so usually produces an upstream error or exposes an unintended response.

Step 4: Create isolated WordPress files and database credentials

Filesystem layout

Create a directory such as /var/www/blog.example.com and unpack WordPress there. Keep it outside the Rails checkout and outside directories used for Rails releases. Set the owner and group so Nginx can read public files and WordPress can write only where your update and upload policy allows.

Permissions should be narrow rather than universally writable. Treat the configuration file, uploaded media directory and any plugin-managed directories separately. A broad recursive write permission makes a compromised plugin more damaging and can hide ownership mistakes.

Database isolation

Create one MySQL or MariaDB database and one user dedicated to WordPress. Grant that user privileges only on the WordPress database. Use a long, unique password stored in your secret-management method, not in a Rails environment file that WordPress does not need.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not reuse the Rails database, Rails database user or Rails credentials. Separate databases make restores predictable and prevent a WordPress SQL mistake from changing application tables that Rails depends on.

Step 5: Add a separate Nginx server block

Create a new server block for the WordPress hostname. Leave the Rails block and its upstream unchanged. The essential directives are a dedicated server_name, WordPress root, index index.php, a front-controller fallback in location /, and a PHP location that passes only existing PHP files to PHP-FPM.

Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
server {
    listen 80;
    server_name blog.example.com;
    root /var/www/blog.example.com;
    index index.php index.html;

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

    location ~ .php$ {
        try_files $uri =404;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php/php-fpm.sock;
    }

    location ~ /. {
        deny all;
    }
}

Replace the example root, hostname and socket with the values on your server. The try_files fallback is what lets WordPress handle pretty-permalink requests through index.php. The PHP location’s own try_files check prevents Nginx from passing arbitrary missing paths to PHP-FPM.

Protect sensitive paths

Use Nginx rules to deny hidden files and other files that should never be downloaded. Review the final configuration for accidental exposure of logs, backups, environment files, database dumps and configuration copies. Do not rely on an .htaccess file: standalone Nginx does not read directory-level Apache configuration, so every rewrite and protection rule must be declared in Nginx.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep PHP handling narrow

Do not create a catch-all PHP handler in the Rails server block, and do not proxy the entire WordPress document root to Rails. PHP requests belong only to the WordPress host and only to PHP-FPM. Static assets should remain static Nginx responses.

Step 6: Test and reload Nginx safely

  1. Run the distribution’s Nginx configuration test, commonly sudo nginx -t.
  2. Inspect the rendered or merged configuration if your distribution provides a command for it. Verify that the new server_name resolves to the intended root and that the PHP location points to the real FPM socket.
  3. Fix every syntax or permission error before reloading. A failed test should not be followed by a reload.
  4. Reload Nginx using the service manager only after the test passes, for example sudo systemctl reload nginx.
  5. Request the Rails hostname and the WordPress hostname separately. Confirm that the former still reaches Rails and the latter serves the new directory.

Testing both names catches the most dangerous class of mistake: a new default server or overly broad location that silently captures Rails traffic.

Step 7: Enable HTTPS for the WordPress hostname

Issue a certificate for the WordPress hostname through the certificate automation already used on the VPS, or through another administrator-managed method. Add an HTTPS server block and redirect HTTP requests to HTTPS. WordPress lists HTTPS as a current requirement, not merely an optional performance feature.

After the certificate is active, open the HTTPS hostname rather than the HTTP address. Check that the certificate name matches the hostname, that no mixed-content warning appears, and that the HTTP endpoint performs the intended redirect. Keep certificate renewal under monitoring; an expired blog certificate can fail independently of the Rails certificate.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 8: Complete the WordPress installer

  1. Visit the WordPress hostname over HTTPS.
  2. Enter the dedicated MySQL or MariaDB database name, user, password and database host.
  3. Choose the site title, administrator name and a unique administrator password.
  4. Confirm the site URL uses the final HTTPS hostname, including the correct scheme and host.
  5. Sign in to /wp-admin, update the permalink setting if required, and save it once to generate the intended rewrite behavior.

Do not use the Rails database host credentials simply because they are already in an environment variable. WordPress’s installer should receive only the credentials created for its own database.

Using a subdirectory instead of a subdomain

If the public URL must remain https://example.com/blog, place WordPress in a separate directory and add path-specific rules to the existing Nginx server. The Rails locations must remain more specific where needed, and the WordPress path must have its own front-controller fallback.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
location ^~ /blog/ {
    try_files $uri $uri/ /blog/index.php?$args;
}

location ~ ^/blog/.*.php$ {
    try_files $uri =404;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass unix:/run/php/php-fpm.sock;
}

The exact ordering and regular-expression interactions depend on the existing Rails locations. Validate the merged configuration and test Rails routes before and after adding these rules. Configure WordPress’s site URL with the /blog path and verify that generated links, administrator pages, media URLs and redirects retain that prefix.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A subdirectory is not a drop-in Apache configuration. Rules copied from a plugin or an .htaccess file do nothing unless translated into Nginx directives. This is why a dedicated hostname is normally easier to operate.

Validation checklist after installation

WordPress checks

  • The home page loads over HTTPS without redirect loops.
  • /wp-admin displays the dashboard and accepts a login.
  • A new media upload succeeds and the file can be served.
  • A post with a pretty permalink loads after saving the permalink settings.
  • PHP errors appear in the expected PHP-FPM or Nginx log rather than as a blank page.

Rails checks

  • The main Rails hostname still reaches the Rails application server.
  • Existing asset, websocket and API routes behave as before.
  • Background jobs continue to run; adding PHP-FPM must not alter the Ruby service or its environment.
  • Rails deploys still switch release directories normally.

Boundary checks

  • The WordPress document root cannot read the Rails release or shared-secret files.
  • The WordPress database user cannot access Rails tables.
  • Requests for a nonexistent PHP file return an error instead of being executed or sent to Rails.
  • HTTP redirects to the intended HTTPS hostname, and the certificate renews successfully.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common failure modes and fixes

PHP requests reach Rails

Symptom: a PHP URL returns a Rails page, an upstream error or an unexpected 404. Cause: the request matched the Rails proxy location or the WordPress PHP location is missing. Fix: verify the WordPress server_name, location precedence and fastcgi_pass. PHP requests must terminate at PHP-FPM, never at the Rails upstream.

Pretty permalinks return 404

Symptom: the home page works but posts and pages fail. Cause: the try_files fallback is absent, points to the wrong path or was placed in a location that does not match the request. Fix: route missing files and directories to the correct index.php, then save the WordPress permalink settings and retest.

The PHP-FPM socket is missing

Symptom: Nginx reports a connection failure to an upstream Unix socket. Cause: the configured path does not match the installed PHP version, the service is stopped, or Nginx lacks access. Fix: find the active socket on this distribution, start the matching PHP-FPM service, correct fastcgi_pass, and inspect service permissions.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The new hostname shows the Rails site

Symptom: the blog hostname displays Rails content. Cause: DNS still points elsewhere, the new server block was not enabled, or Nginx selected a default server. Fix: verify DNS resolution, the exact server_name, the enabled configuration path and the result of the Nginx test. Request the hostname with HTTPS after certificate installation as well as with HTTP.

WordPress cannot connect to its database

Symptom: the installer reports a database connection or authentication error. Cause: incorrect host, database name, username, password, server availability or privileges. Fix: test the dedicated credentials independently, confirm the database service is listening on the expected private interface, and grant the WordPress user access only to its own database.

Uploads fail or updates are blocked

Symptom: media uploads or plugin updates fail with a permission error. Cause: the Nginx/PHP-FPM worker cannot write to the intended upload or update directory, or ownership is too restrictive. Fix: identify the actual worker account, grant write access only to the directories that need it, and avoid making the entire document root universally writable.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Configuration changes break both applications

Symptom: Rails and WordPress fail after one edit. Cause: a shared server block was overwritten or a broad location was inserted above existing rules. Fix: restore the saved Rails configuration, remove the new block temporarily, run the Nginx test, then reintroduce the WordPress block as an independent file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Security and maintenance boundaries

Updates

Keep the operating system, Nginx, PHP-FPM, WordPress core, themes and plugins updated on schedules appropriate to their security notices. Test updates on the WordPress site without changing the Rails deployment process. PHP version upgrades require checking the FPM service name, socket path and plugin compatibility.

Logs and monitoring

Monitor Nginx access and error logs, PHP-FPM logs, the WordPress application logs you intentionally enable, the Rails application logs and the database logs separately. Alerts should identify which service failed; a generic VPS CPU alert does not tell you whether Rails, PHP-FPM or the database is responsible.

Backups and restore tests

Back up the WordPress database and document root, including uploaded media and the configuration data required to reconnect the site. Keep these backups separate from Rails backups when practical. A backup is useful only if you periodically restore it to an isolated location and confirm that the restored files and database produce a working WordPress site.

Least privilege

Use separate Unix ownership and database credentials, restrict administrative interfaces, and keep the database listener private. Do not expose database ports merely because both applications share a VPS. Review Nginx rules after every plugin or permalink change, since Nginx—not an .htaccess file—controls request handling.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When a second VPS is the better choice

One VPS is technically sufficient when its CPU, memory, storage and operational processes can support both workloads, but shared infrastructure creates a shared failure domain. Consider a second server if Rails and WordPress have conflicting PHP or system-package requirements, if either workload routinely exhausts resources, if independent maintenance windows are essential, or if a compromise of one application must not provide a path to the other application’s host.

If you stay on one VPS, preserve the boundaries described here: separate hostname or path rules, separate document roots, separate runtimes, separate database credentials, explicit TLS, tested reloads and recoverable backups.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.