Question

How to Optimize Ghost CMS Performance on DigitalOcean Droplets?

I recently deployed Ghost CMS on a DigitalOcean Droplet, and while it’s running fine, I want to optimize its performance for better speed and efficiency. I came across some optimizations related to caching and database tuning, where they discussed various ways to improve web application performance. However, I’m looking for more insights specific to Ghost CMS.

Some specific areas I’m looking for advice on:

  1. Caching Strategies – Should I use NGINX caching, Redis, or Cloudflare for better performance?
  2. Database Optimization – Any tips for tuning MySQL (or SQLite) to handle higher traffic loads?
  3. Droplet Sizing – What’s the ideal CPU/memory allocation for a Ghost blog with moderate traffic?
  4. CDN Integration – Is there a recommended setup for serving images and static assets more efficiently?

Has anyone implemented these optimizations on their Ghost setup? Would love to hear your recommendations!


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
February 2, 2025

Hey! 👋

I could suggest a few things here when optimizing Ghost CMS on a DigitalOcean Droplet!

If you haven’t started yet, I would recommend the 1-Click Ghost Droplet from the Marketplace that already comes with some optimizations out of the box:

https://marketplace.digitalocean.com/apps/ghost

To scale up, I would recommend using a managed MySQL cluster which already comes with performance configurations out of the box:

https://www.digitalocean.com/products/managed-databases-mysql

Besides that I would recommend a few more things:

  • Use Cloudflare for global caching & DDoS protection.
  • Enable NGINX FastCGI cache or Redis to speed up responses.

Speaking of Redis, you can also use it for session storage to reduce the load on the database itself. DigitalOcean also offers a managed Redis solution so this is something that you might want to consider as well:

https://www.digitalocean.com/products/managed-databases-redis

On the Droplet size itself:

  • A 1vCPU / 2GB RAM Droplet is fine for low-medium traffic.
  • Scale up to 2vCPU / 4GB RAM if you see slowdowns. And also consider using a CPU optimize plan for better performance.

- Bobby

KFSys
Site Moderator
Site Moderator badge
February 3, 2025

Heya,

Here are some other types of optimizations you can try.

1. Caching Strategies

Caching is crucial for improving the speed and reducing the load on your server.

Since Ghost runs on Node.js, NGINX can act as a reverse proxy to handle caching efficiently.

  • Enable microcaching for fast-moving content (e.g., blog pages):
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=ghost_cache:10m max_size=1g inactive=60m use_temp_path=off;

server {
    location / {
        proxy_cache ghost_cache;
        proxy_cache_valid 200 60m;
        proxy_cache_use_stale error timeout updating;
        proxy_pass http://localhost:2368;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
    }
}
  • This caches pages for 60 minutes, reducing database queries and API calls.

Redis Caching (For API calls & DB queries)

  • Ghost uses Bookshelf.js, which can benefit from Redis caching.
  • To enable Redis caching:
    1. Install Redis:
sudo apt update && sudo apt install redis-server

Configure Ghost to use Redis (config.production.json):

{
  "caching": {
    "enabled": true,
    "type": "redis",
    "host": "127.0.0.1",
    "port": 6379
  }
}

Restart Ghost.

Cloudflare (Best for Global Performance)

If your audience is global, Cloudflare provides: ✅ Edge caching (static HTML, images, CSS, JS) ✅ DDoS protectionAutomatic image optimization To configure:

  • Enable “Cache Everything” for / but exclude /ghost/* (admin panel).
  • Use “Automatic Platform Optimization (APO)” for speed.

2. Database Optimization

Ghost supports MySQL and SQLite, and both need tuning for performance.

  1. Enable Query Caching:
[mysqld]
query_cache_size = 64M
query_cache_type = 1

Don’t forget to Restart MySQL.

Optimize Indexing

sudo mysqlcheck -o ghost_production -u root -p

Enable InnoDB Buffer Pool Tuning:

innodb_buffer_pool_size = 512M
innodb_buffer_pool_instances = 2

CDN Integration (Serving Static Assets)

Ghost supports CDN for images via config.production.json.

  1. Use Cloudflare or KeyCDN
  2. Configure Ghost:
    • Edit config.production.json:
{
  "storage": {
    "active": "ghost-storage-cloudinary",
    "ghost-storage-cloudinary": {
      "useDatedFolder": false,
      "secure": true
    }
  }
}

Install Cloudinary storage adapter

npm install ghost-storage-cloudinary

Restart Ghost.

You can also try adding Brotli Compression in NGINX.

sudo apt install brotli

Then add:

server {
    location / {
        brotli on;
        brotli_types text/html text/css application/javascript;
    }
}

Enable Lazy Loading for images:

  • Ghost automatically does this for featured images, but for inside posts, use:
<img src="image.jpg" loading="lazy">
alexdo
Site Moderator
Site Moderator badge
February 3, 2025

Heya, @f60f754977ec49e1b2cad3cf42286e

Ghost has internal caching that can be optimized. You can modify Ghost’s internal caching by editing config.production.json:

"caching": {
  "enabled": true,
  "type": "memory",
  "max": 500
}

Regards

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.