How to run geth at 512Mb RAM Digital Ocean droplet

Peter Porobov
HackerNoon.com
4 min readJan 31, 2017

--

Run geth with just 512Mb of RAM

This is how I run full geth node alongside TheMillionEtherHomepage.com python back-end on a low-cost Digital Ocean (DO) Ubuntu droplet. With this config I’m in full sync (currently at block 3097083) with no crashes at all.

Create a droplet

Buy a 512 Mb RAM droplet and attach at least 20 GB volume to it (DO’s block storage). Just click Create droplet button and DO will guide you through.

Setup a swapfile

I tried to run geth with no swap, but it crashes in about 10–30 minutes after start. Here I’m setting up 2 Gigs of swap. One Gig is not enough. I had one kill with it within 2 mln blocks.

Digital Ocean’s instructions on swap are available here: How To Add Swap on Ubuntu 14.04

Install geth

Official Installation Instructions for Ubuntu

Put geth’s database to the block storage volume

You can run geth with datadir “/mnt/your-volume-name/ethereum/” key (Geth Command Line Options), but I find the following approach simpler as you may have other software using the same ~/.ethereum folder by default. So we gonna create a symbolic link.

Run geth and enjoy!

And add stats to enjoy even more.

Add a cron task through:

At the bottom add the following task. It will write your attached volume usage to the disk.log file every day at 4 A.M.

And in a couple of days check the logs to see your disk usage stats. If you see disk space running low, it is time to think of buying up more space.

Set up monit to monitor Geth and enjoy even when you go to sleep.

To feel safer you can set up monit to monitor Geth status. It will restart geth if anything happens to it and inform you by email.

Comments, questions, improvements?

You can post them here or at the stackexchange thread: How to run geth at 512Mb RAM Digital Ocean droplet?

UPDT: Had two crashes: on 17th and 25th of March. So I highly recommend monitoring geth with monit or other software.

Hacker Noon is how hackers start their afternoons. We’re a part of the @AMI family. We are now accepting submissions and happy to discuss advertising & sponsorship opportunities.

If you enjoyed this story, we recommend reading our latest tech stories and trending tech stories. Until next time, don’t take the realities of the world for granted!

--

--

Peter Porobov
HackerNoon.com

TheMillionEtherHomepage.com — Buy pixels, sell pixels, advertise, help charity. Medium.com/six-degrees-of-separation — identity proof system on blockchain.