Docker image that runs a full Monero node node in a container for easy deployment.
The service runs as user id 1337, this has some implications when mounting host directories on it.
In order to setup a Monero node with the default options perform the following steps:
docker volume create --name=monerod-data
All the data the service needs to work will be stored in the volume. The volume can then be reused to restore the state of the service in case the container needs to be recreated (in case of a host restart or when upgrading the version).
monerod image.docker run -d \
--name monerod-node \
-v monerod-data:/home/monero/.bitmonero \
-p 18080:18080 \
-p 18081:18081 \
--restart unless-stopped \
salessandri/monerod:latest
This will create a container named monerod-node which gets the host's ports 18080 and 18081 forwarded to it.
Also this container will restart in the event it crashes or the host is restarted.
docker logs -f monerod-node
bitmonero.conf file on /home/monero/.bitmonero/bitmonero.confIf one wants to write their own bitmonero.conf and have it persisted on the host but keep all the
monero data inside a docker volume one can mount a file volume on /home/monero/.bitmonero/bitmonero.conf after the mounting of the data volume.
Note: Make sure the file is readable by UID 1337
Example:
docker run -d \
--name monerod-node \
-v monerod-data:/home/monero/.bitmonero \
-v /etc/bitmonero.conf:/home/monero/.bitmonero/bitmonero.conf \
-p 18080:18080 \
-p 18081:18081 \
--restart unless-stopped \
salessandri/monerod:latest
bitmonero.conf in the data directoryInstead of using a docker volume for the data, one can mount directory on /home/monero/.bitmonero/ for the container to use as the data directory.
If this directory has a bitmonero.conf file, this file will be used.
Just create a directory in the host machine (e.g. /var/monero-data) and place your bitmonero.conf file in it.
Then, when creating the container in the docker run, instead of naming a volume to mount use the directory.
Prior using, make sure that the directory as well as the file are owned by UID 1337. Otherwise the service will not be able to write data to it.
mkdir /var/monero-data
vim /var/monero-data/bitmonero.conf
sudo chown -R 1337:1337 /var/monero-data
docker run -d \
--name monerod-node \
-v /var/monero-data:/home/monero/.bitmonero \
-p 18080:18080 \
-p 18081:18081 \
--restart unless-stopped \
salessandri/monerod:latest
Content type
Image
Digest
sha256:06444d1f8…
Size
38.1 MB
Last updated
about 4 years ago
docker pull salessandri/monerod