Skip to main content

Self-host multilingual Ghost blog with subdirectory routing

To support two languages, you’ll need to install 2 Ghost sites on the same server, setting up separate instances for each language.

  1. Default English - https://domain.com
  2. Vietnamese - https://domain.com/vi/
  3. German - https://domain.com/de/

Option 1: Hosting with SynapsMedia (Best & Simplest)

If you don’t want to deal with complex server management, command-line interfaces, reverse proxies, or writing configuration files, using SynapsMedia is the best option.

SynapsMedia is a professional, managed Ghost hosting service that officially supports subdirectory multi-language routing natively.

Why choose SynapsMedia?

  • Fully Managed: They handle server setup, maintenance, security, and updates.
  • Subdirectory Support: You can easily run your primary site at https://domain.com and secondary language sites as subdirectories like https://domain.com/vi/ or https://domain.com/de/.
  • No Code Required: No need to configure Nginx, write YAML files, or manage SSH keys.
  • Expert Support: Outstanding technical support specialized in Ghost CMS.

Key Benefits of SynapsMedia Subdirectory Setup

  • Shared Newsletter Quota: Sites under the same domain share their email limits. If you have 3 sites under the same domain, and each has 2,000 monthly newsletter credits, they share a combined pool of 6,000. Credits are automatically deducted in this order: the sending site, then the root site, then other connected sites under the same domain.
  • Shared Custom Sending Domain: Subdirectory installs automatically inherit the custom sending domain from the root site.
  • Lower Cost: Subdirectory installs benefit from a 10% multi-site discount.
  • Unlimited Subdirectory Sites: Create as many subdirectory sites as you need (e.g. /vi, /de, /fr, /docs, /blog).

How to Configure Subdirectory Installs on SynapsMedia

To set up subdirectory multi-language routing on SynapsMedia, follow these simple steps:

  1. Create Publications: Ensure you have at least 2 Ghost publications running under your SynapsMedia account (one will be the primary site, the other will be the secondary language site).
  2. Access Settings: In the SynapsMedia Panel, go to the settings page of the Ghost site you want to run under a subdirectory (the secondary language site).
  3. Enable Subdirectory Install: Scroll down to the Domains section and click the Enable subdirectory install button.
  4. Configure Routing:
    • In the Domain dropdown field, select the main domain of your active primary Ghost site.
    • In the Subdirectory path field, enter the desired path (e.g., vi or de).
  5. Save and Restart: Click Enable Subdirectory Install. SynapsMedia will automatically reconfigure and restart both the primary and secondary publications within a minute.
Easy setup subdirectory routing on Synaps Media
Easy setup subdirectory routing on Synaps Media

Rules and Restrictions to Keep in Mind

  • Separate Ghost Admins: The admin panels for each site remain separate. You can access the subdirectory’s admin panel at https://domain.com/{subdir}/ghost/.
  • Email Deliverability: All publications under the same domain will send membership and newsletter emails using the same sending domain config from the root site.
  • Sitemaps & Robots.txt: Sitemaps are separate; you will need to submit the subdirectory sitemap to Google Search Console manually. For robots.txt, you must manually merge rules on your root publication since they do not merge automatically.
  • Social Web: The Social Web (ActivityPub federation) feature is disabled on subdirectory installations.

Hosting Ghost Multilingual on Railway

This guide provides a detailed, step-by-step walkthrough for deploying a full multilingual Ghost setup on Railway using this reverse proxy template.

Prerequisites

  • A Railway account.
  • A custom domain you own (e.g., your-domain.com).
  • At least two Ghost instances deployed on Railway (one for each language).

1. Deploy Ghost Nginx proxy template

Deploy Ghost Nginx proxy template
Add new 2 Ghost instances on Railway
  1. Click Railway wizard button below to auto deploy our deploy template on Railway. Deploy on Railway

  2. Add first Ghost instance for your primary blog.

    Add new > Search “Ghost” > Add Ghost template

  3. Add secondary Ghost instance for your other blog.

    Add new > Search “Ghost” > Add Ghost template

At the end of this step, you should have 2 separate Ghost services + 1 Ghost Multilingual Nginx proxy running in your Railway project.

2. Configure Environment Variables

This is the most critical part of the setup. You need to configure the variables for all three services so they can communicate with each other.

  1. Find Your Internal URLs.

    Find Your Internal Service URLs on Railway
    Internal URL is in Private Networking

    First, you need the internal URLs for your ghost and ghost-fr services. In Railway, go to the Settings tab of each Ghost service.

    Under the Networking section, you will find a private URL ending in .railway.internal.

    It will look something like http://ghost.railway.internal:2368.

  2. Configure the Ghost Multilingual Nginx Proxy Service.

    Configure the Ghost Multilingual Nginx Proxy Service
    Fill out the requirements fields

    SERVER_NAME: Your custom domain (e.g., your-domain.com).

    GHOST_ROOT_URL: The internal URL of your main Ghost instance on Railway (e.g., http://ghost.railway.internal:2368).

    GHOST_INSTANCES: The path and internal URL for your other Ghost instances (e.g., /fr:http://ghost-fr.railway.internal:2368).

  3. Configure the Ghost Instances

    Configure the Ghost Instances
    Set new url for each Ghost instance

    Go to the settings for your main Ghost instance on Railway.

    In the Variables tab, set the url variable to your full public domain.

    Example: https://your-domain.com

    Go to the settings for your additional Ghost instance (e.g., the French version).

    In the Variables tab, set the url variable to your full public domain including the subdirectory path.

    Example: https://your-domain.com/fr/

3. Add Custom Domain

Add Custom Domain

Finally, you need to point your custom domain to the reverse proxy.

  1. In the ghost-multilingual-reverse-proxy service settings on Railway, go to the Settings tab.
  2. Under the “Networking” section, click + Add Domain and enter your custom domain (e.g., your-domain.com).
  3. Follow Railway’s instructions to configure the CNAME record with your DNS provider.
  4. Ensure the domain points to the service port 8080.

After completing these steps and allowing some time for DNS propagation, your multilingual Ghost site should be live.

Navigating to https://your-domain.com will show the English blog, and https://your-domain.com/fr/ will show the French blog.


Option 3: Hosting Ghost Multilingual on DigitalOcean

Ready to go multilingual? This guide walks you through every single step to deploy a complete Ghost setup on DigitalOcean. Prerequisites

  1. DigitalOcean account (if have not one, register new DigitalOcean account here)
  2. Termius Software on your Desktop (Free download it here)

1. Generate SSH Key for Server Access

If you don’t already have an SSH key, follow these simple steps:

  1. Open Termius (which you downloaded earlier).
  2. Navigate to Settings > Keychain > Generate Key.
  3. Name your key label and select RSA as the key type.
  4. Click on Generate and Save.
Generate SSH key
Generate SSH key

Make sure to copy and securely store both the Private Key and Public Key. These keys will be essential for secure access to your server.

Public Key look like
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCUBJ2jKLbwL580TuD/+txGQpq7JuMVgz4ha5U097BhyU2q50GvzgKpipxxxx...

Note

Public Key will be used for create new server DigitalOcean, so keep it for next step.

2. One-click install ghost

Refer to the official Ghost documentation for a step-by-step guide on installing Ghost.

However, make sure to create a new server with a minimum of 2GB RAM as per the requirements (2 ghosts).

One-click install will auto install all server requirements for ghost.

Play

Watch the video above as it guides you through the one-click installation of Ghost on DigitalOcean, providing easy-to-follow instructions.

type your domain
Type your domain

Note

In Termius, you can use Ctrl + U to delete all text on the current line in the terminal. If there are incorrect texts during the process, this shortcut will help you clear the line quickly.

3. Install the second ghost

Refer to Aspire Themes tutorials for a step-by-step guide on installing sencond Ghost on DigitalOcean. Thanks Aspire Themes.

However, there are some differences.

Use Termius to access the DigitalOcean server.

Access DigitalOcean server
Access DigitalOcean server
  1. You need the current MySQL host, username, and password.

    Terminal window
    cd /var/www/ghost/
    cat config.production.json

    Take notes of them. You will use them later in steps 3 and 5.

  2. Create a website directory ghost-de

    Terminal window
    cd /var/www/
    sudo mkdir ghost-de
    sudo chown ghost-mgr:ghost-mgr ghost-de/
  3. Login to MySQL and create a new database

    Terminal window
    sudo mysql -u root -p
    CREATE DATABASE ghost_de;
    GRANT ALL PRIVILEGES ON ghost_de.* to 'ghost'@'localhost' IDENTIFIED BY '7d150600c49e7c5860be7ce03d4f8df67259176738d926ec';
    FLUSH PRIVILEGES;
    exit

    Note down:

    MYSQL password: 7d150600c49e7c5860be7ce03d4f8df67259176738d926ec

    Database name ghost_de

    You will need it for for step 5.

  4. Switch to the ghost-mgr user

    Terminal window
    sudo -i -u ghost-mgr
  5. Install Ghost and follow the installation steps

    Terminal window
    cd /var/www/ghost-de/
    ghost install

    At Blog URL question, you need to fill https://yourdomain.com/de

    Check more ghost install with CLI

4. Config Nginx

Play
  1. Edit domain.com-ssl.conf

    Terminal window
    cd /etc/nginx/sites-availables
    ls
    nano domain.com-ssl.conf

    Note

    Replace your real domain

  2. Add proxy block as below

    domain.com-ssl.conf
    ...
    location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $http_host;
    proxy_pass http://127.0.0.1:2368;
    }
    location /de/ {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $http_host;
    proxy_pass http://127.0.0.1:2369;
    }
    ...
  3. Now you 2 ghosts and can access to ghost admin at:

    English site (primary language) — https://domain.com/ghost/

    German site (secondary language) — https://domain.com/de/ghost/

Check the Ghost Config documentation for instructions on setting up SMTP and other configurations for each Ghost instance.


Option 4: Hire Fiverr freelancer for help

Don’t let technical difficulties hold you back — tap into Fiverr’s network of skilled Ghost freelancers and get your Ghost project up and running in no time!

With a wide range of expertise, they can guide you through the intricacies of Ghost, ensuring a smooth and efficient deployment process.