# Ghost on 1GB Digital Ocean droplet using 100% of memory

**URL:** <https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444>\
**Category:** Self-hosting\
**Created:** [August 30, 2022, 7:31pm UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444 "2022-08-30T19:31:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinverbic](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/martinverbic/32/24543_2.png) [@martinverbic](https://forum.ghost.org/u/martinverbic)\
**Post date:** [August 30, 2022, 7:31pm UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/1 "2022-08-30T19:31:50Z")

</div>

I’m having troubles with my Digital Ocean memory usage (base droplet with 1GB of RAM). I’m trying to set up one Ghost site with 2 posts for now and virtually no traffic (a lot of theme changes/uploads though), but the memory graph hits 100%. `free -h` command indicates only 56MB free memory…any recommendations?

Website data  
URL: [https://blog.damahealth.com/](https://blog.damahealth.com/)  
Version: 5.12.0  
Environment: Production  
Database: mysql8  
Mail: SMTP

---

<div class="post-metadata">

**Author:** ![ericalli](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ericalli/32/3806_2.png) [@ericalli](https://forum.ghost.org/u/ericalli)\
**Post date:** [August 31, 2022, 1:05am UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/2 "2022-08-31T01:05:30Z")

</div>

You could try adding a swap space, which typically helps with running out of memory. Here’s Digital Ocean’s official guides for doing so:

> **[How To Add Swap Space | DigitalOcean](https://www.digitalocean.com/community/tutorial_collections/how-to-add-swap-space)**
>
> An easy way to make your server more responsive, and guard against out-of-memory errors in your applications, is to add some swap space. Swap is an area …

---

<div class="post-metadata">

**Author:** ![martinverbic](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/martinverbic/32/24543_2.png) [@martinverbic](https://forum.ghost.org/u/martinverbic)\
**Post date:** [August 31, 2022, 5:34am UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/3 "2022-08-31T05:34:56Z")

</div>

Thanks, of course. But I’d first like to find the cause for this and try to solve it.

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [August 31, 2022, 2:41pm UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/4 "2022-08-31T14:41:18Z")

</div>

Install and run `htop` or `glances` to see what’s using memory. In addition, optimize Nginx.

> **[How To Optimize Nginx Configuration | DigitalOcean](https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration)**
>
> Nginx is a fast and lightweight alternative to the sometimes overbearing Apache 2. However, Nginx just like any kind of server or software must be tuned to …

---

<div class="post-metadata">

**Author:** ![RyanF](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ryanf/32/17448_2.png) [@RyanF](https://forum.ghost.org/u/RyanF)\
**Post date:** [August 31, 2022, 3:43pm UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/5 "2022-08-31T15:43:11Z")

</div>

Another method to help debug this:

- Restart your server and on a fresh boot, see how much memory is being used. You’ll then have a better baseline to see how much Ghost is using on top of that
- Start Ghost. Recheck memory usage.

You’ll then have a bit better sense of memory usage. You’re also paying for 1GB — might as well use as much of it as you can 😄

---

<div class="post-metadata">

**Author:** ![martinverbic](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/martinverbic/32/24543_2.png) [@martinverbic](https://forum.ghost.org/u/martinverbic)\
**Post date:** [August 31, 2022, 4:00pm UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/6 "2022-08-31T16:00:06Z")

</div>

Thank you both. I’ll se what I can do.

I ran `htop` and my Ghost usage is about 130MB, which is normal I guess. Without Ghost running and on a fresh boot, the usage was about 530MB.

I imagine that when I ran a lot of theme updates and added more staff to Ghost the usage increased.

I guess I’m trying to understand if this usage is normal - if it this, then fine I’ll upgrade to 2gb. Sharing the baseline `htop` result.

 ![Screenshot 2022-08-31 at 17.53.24](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/c/f/cfdff799a236d38863d2f50c37c0831b3695ddc4.jpeg)  
 ![Screenshot 2022-08-31 at 17.53.34](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/1/d/1d2e70d46ea7b7c39ff901969c1bd6e95b2a86a0.jpeg)

---

<div class="post-metadata">

**Author:** ![RyanF](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ryanf/32/17448_2.png) [@RyanF](https://forum.ghost.org/u/RyanF)\
**Post date:** [August 31, 2022, 6:06pm UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/7 "2022-08-31T18:06:01Z")

</div>

This looks expected to me and will function fine. Going up to 2GB will give you more headroom, but you could also add some swap like @mjw shared.

---

<div class="post-metadata">

**Author:** ![jazmy](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jazmy/32/19261_2.png) [@jazmy](https://forum.ghost.org/u/jazmy)\
**Post date:** [August 31, 2022, 11:51pm UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/8 "2022-08-31T23:51:39Z")

</div>

Hi Martinverbic, 😀

Here are a couple tricks I use to maximize my memory on digital ocean. I recently shared theses tips plus more in a medium article. I was trying to host multiple ghost blogs on one droplet so these tweaks were important.  
[https://jazmy.medium.com/multiple-ghosts-instances-on-digital-ocean-droplet-43079693aa09](https://jazmy.medium.com/multiple-ghosts-instances-on-digital-ocean-droplet-43079693aa09)

# Optimizing your Digital Ocean Droplet

## Swap File

Swap is a space on a disk that is used when the amount of physical RAM memory is full. When our droplet runs out of RAM, inactive pages are moved from the RAM to the swap space. The swap file will not be as fast as ram, but it will definitely help.

_Note: If you have 1GB of RAM, then it is recommended that your swap file be 2GB._

## Log Rotation

The Ghost blog platform doesn’t automatically set up log rotation when it is installed. As a result, Ghost will perpetually append to its log files until you run out of disk space. Setting up log rotation will ensure you only keep one week’s worth of ghost logs.

- [Instructions on creating a log rotation](https://engineerworkshop.com/blog/save-your-disk-space-by-setting-up-logrotate-for-your-ghost-cms/)

## Use Cloud Flare

Adding the free version of Cloudflare will improve performance by blocking bad actors as well as caching your site on their CDN, which decreases the load on your server.

## Reduce Ram Usage by MySQL

This tip dropped my RAM usage by 16%

[https://www.riccardofeingold.com/how-to-reduce-ram-usage-of-ghost-and-mysql/](https://www.riccardofeingold.com/how-to-reduce-ram-usage-of-ghost-and-mysql/)

I hope these are helpful,  
Jaz

---

<div class="post-metadata">

**Author:** ![martinverbic](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/martinverbic/32/24543_2.png) [@martinverbic](https://forum.ghost.org/u/martinverbic)\
**Post date:** [September 1, 2022, 7:21am UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/9 "2022-09-01T07:21:35Z")

</div>

Thanks for the answers, this really helps🙏

---

<div class="post-metadata">

**Author:** ![danfercf](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/danfercf/32/16118_2.png) [@danfercf](https://forum.ghost.org/u/danfercf)\
**Post date:** [September 2, 2022, 6:38pm UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/10 "2022-09-02T18:38:00Z")

</div>

Regarding your htop results, who is using a 39% of memory is MySQL, I faced with the same problem with a blog using the AWS free tier with 1G, I configured the minimal configuration for MySQL and the MySQL RAM usage drop down almost 40% and I added a script to free up RAM every certain time using a cronjob. You can find how I did it here [https://danfercf.info/how-to-add-a-ram-free-up-script-into-raspbian-for-a-raspberry-pi-2-b/](https://danfercf.info/how-to-add-a-ram-free-up-script-into-raspbian-for-a-raspberry-pi-2-b/) it’s for a Raspberry but I used the same for the AWS EC2.

---

<div class="post-metadata">

**Author:** ![victor-sopot](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/victor-sopot/32/17943_2.png) [@victor-sopot](https://forum.ghost.org/u/victor-sopot)\
**Post date:** [September 4, 2022, 11:29am UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/11 "2022-09-04T11:29:01Z")

</div>

I think 1GB is the bare minimum required by Ghost. I was having this exact same issue. I actually upgraded to a 2GB memory server and still faced around 60-80% load when running `free`

My solution was to switch entirely to a self-hosted Contabo VPS where they offer much more memory for a much better price.

---

<div class="post-metadata">

**Author:** ![gohere](https://avatars.discourse-cdn.com/v4/letter/g/a587f6/32.png) [@gohere](https://forum.ghost.org/u/gohere)\
**Post date:** [March 7, 2024, 10:58am UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/12 "2024-03-07T10:58:59Z")

</div>

Extremely helpful. Thank you. They should add it to self-host docs, damn!

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [March 8, 2024, 1:58pm UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/13 "2024-03-08T13:58:18Z")

</div>

I solved all this Digital Ocean nonsense by just migrating to Pikapods. It’s not worth wasting time with them.

---

<div class="post-metadata">

**Author:** ![gohere](https://avatars.discourse-cdn.com/v4/letter/g/a587f6/32.png) [@gohere](https://forum.ghost.org/u/gohere)\
**Post date:** [March 14, 2024, 2:29pm UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/14 "2024-03-14T14:29:46Z")

</div>

Nice find! I was not aware other providers have Ghost app to be installed in 1 click like DigitalOcean does.

Can you share your setup?

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [March 14, 2024, 8:16pm UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/15 "2024-03-14T20:16:21Z")

</div>

My setup is a pod with 2 CPU, 2 GB ram, everything behind Cloudflare. This is good enough for a Ghost blog. Monthly cost: around $3.

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [March 14, 2024, 8:21pm UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/16 "2024-03-14T20:21:54Z")

</div>

While with Digital Ocean I had to spend weeks to figure out to how optimize and update the Droplet, with Pikapods I didn’t even spend 5 minutes in their admin panel, because it’s 100% managed and it never crashes like Digital Ocean.

They take care of Ghost updates, emergency backups and so on for a fraction of the price. Also, to setup the Ghost newsletter is very simple: just fill the ENV Vars form in the pod options with your Mailgun credentials, and you are good to go.

---

<div class="post-metadata">

**Author:** ![martinverbic](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/martinverbic/32/24543_2.png) [@martinverbic](https://forum.ghost.org/u/martinverbic)\
**Post date:** [March 14, 2024, 8:30pm UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/17 "2024-03-14T20:30:49Z")

</div>

Since my last message in this topic I migrated everything to a basic server on [Contabo](https://contabo.com/en/). The price is 4.5€+VAT/month with more than enough space. I use it to power 4 Ghost blogs, one static HTML site and Plausible analytics. It is a bit of work but still, works perfect. Highly recommended!

---

<div class="post-metadata">

**Author:** ![gohere](https://avatars.discourse-cdn.com/v4/letter/g/a587f6/32.png) [@gohere](https://forum.ghost.org/u/gohere)\
**Post date:** [March 15, 2024, 9:46am UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/18 "2024-03-15T09:46:59Z")

</div>

Well damn, I have just migrated from Ghost Pro to DigitalOcean (1 week ago) and you told me this! I will migrate again and hopefully stay there for more than a week lol

---

<div class="post-metadata">

**Author:** ![block](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@block](https://forum.ghost.org/u/block)\
**Post date:** [March 15, 2024, 9:54am UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/19 "2024-03-15T09:54:18Z")

</div>

Price aside, I think you can stay with Digital Ocean a few more months if you don’t need to update Ghost and have days of time to setup and customize everything. After one year I honestly gave up, I don’t have time for that…

---

<div class="post-metadata">

**Author:** ![gohere](https://avatars.discourse-cdn.com/v4/letter/g/a587f6/32.png) [@gohere](https://forum.ghost.org/u/gohere)\
**Post date:** [March 15, 2024, 11:23am UTC](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444/20 "2024-03-15T11:23:01Z")

</div>

it’s not about the price, it is about the management. I am also surprised that I had to do all that swap, log, mysql optimization, etc. stuff. Also you said PikaPods update droplets themselves, with DigitalOcean I see I have to update with ghost-cli. They also give some % to open-source projects. Basically, it is amazing and exactly what I was looking for.

I should have 2 month free in DigitalOcean so I am not in a hurry. Other self-hosted Ghost users should know about PikaPods, and maybe PikaPods should also have a referral program…

[Next page](https://forum.ghost.org/t/ghost-on-1gb-digital-ocean-droplet-using-100-of-memory/32444.md?page=2)
