Running it on such a low amount of RAM might be tricky. I know the devs have made attempts to reduce RAM usage so it could run on Raspberry PI, but even that has 1GB of RAM.
In addition to making a large swap file, you might want to try RAM compression. This might help on a VPS that has ample CPU power, but restricted RAM resources. On Ubuntu you can just run the command sudo apt-get install zram-config
and it will install and configure it. To confirm it is running run the command sudo cat /proc/swaps
and you should see something like this:
Filename Type Size Used Priority
/dev/sda4 partition 2095280 0 -1
/dev/zram0 partition 507596 65800 5
/dev/zram1 partition 507596 65728 5
To have Ethereum autolaunch and restart, on Ubuntu I would recommend using Systemd. Just edit the config below and drop it into the file /lib/systemd/system/geth.service
:
[Unit]
Description=Ethereum Go client
[Service]
ExecStart=/usr/bin/geth --lightserv 25 --lightpeers 50
Restart=always
RestartSec=30
Type=simple
User=ethereum
[Install]
WantedBy=default.target
The Systemd config above specifies that the client runs as a light server as the user ethereum
. You should edit this config as needed.
Then run the command sudo systemctl enable geth
to enable autolaunch on boot. Use the following commands to start, stop, and check the status:
sudo systemctl start geth
sudo systemctl stop geth
sudo systemctl status geth
If you keep experiencing problems, I would suggest you try out the experimental light client. It is designed for lower power systems and has a much lower RAM and HDD burden
ExecStart=/usr/bin/geth --light