Skip to main content

Linux VPS (Docker)

We will be using Docker software to make running a Minima node simple. If you prefer not to use Docker, you can create a script to run Minima as a service.

What is Docker?

Docker is an open-source software platform that simplifies the process of running, testing and managing applications. It uses the operating system of the computer on which it’s installed to provide an independent computing environment for an application to run on.

Setup your Firewall​

If using Docker to run your node on a VPS, you must not rely on UFW as your firewall, Docker will overwrite UFW firewall rules. You must use your VPS provider's firewall manager.

After configuring your firewall, you should check they are enforced as expected.

For more information, see System Requirements.

Start a new Minima node​

  1. Log on as a non root user with sudo (admin) rights and add a new minima user, set a password and leave the remaining fields as default :
sudo adduser minima

Please make a note of the password you set for the minima user, you may have to login as this user later.

VPS_adduser

  1. Confirm the new user with y
  2. Give sudo (admin) permissions to the minima user:
sudo usermod -aG sudo minima

VPS_adduser2

  1. Switch to minima user:
su - minima

VPS_loginnewuser

  1. Download the docker install script:
sudo curl -fsSL https://get.docker.com/ -o get-docker.sh

VPS_getdocker

  1. Give the script permissions and run the installer for docker - this will take a few minutes to finish:
sudo chmod +x ./get-docker.sh && ./get-docker.sh

VPS_installdocker

  1. Add the minima user to the Docker group:
sudo usermod -aG docker $USER
  1. Exit back to original user:
exit
  1. Switch to minima user to refresh the groups:
su - minima

VPS_switchuser

  1. Start the container for your node:
SET YOUR PASSWORD

Set your password below to at least 12 characters using alphanumeric characters and symbols.

docker run -d -e minima_mdspassword=INSERTPASSWORD -e minima_server=true -v ~/minimadocker9001:/home/minima/data -p 9001:9001 -p 127.0.0.1:9003:9003 --restart unless-stopped --name minima9001 minimaglobal/minima:latest
What do all the parameters mean?
-d: daemon mode, Minima will run in the background

-e minima_mdspassword=IN$ERTPA$$WORD : sets the password to login to your node.

-e minima_desktop=true : sets your node type as a desktop node that does not receive incoming connections

-v ~/minimadocker9001:/home/minima/data : creates a local folder called minimadocker9001 in your home directory and maps it to the /home/minima/data directory in Docker. The minimadocker9001 folder is where the Minima database and is also where your backups will be stored.

-p 9001-9003:9001-9003 : the port number mapping from your desktop to the Docker container

--restart unless-stopped : ensures your container automatically restarts unless you stop it

--name minima9001 : sets the name of your Minima container to minima9001

minimaglobal/minima:latest : specifies the Minima docker image

Optional additional startup parameters

The following start up parameters can optionally be specified when starting your Docker node.

To add/remove parameters after a node has been started, you must stop and remove your minima9001 Docker container, then start it again, adding/removing the required parameters in front of -v ~/minimadocker9001:/home/minima/data. As long as you use the same minimadocker8001 folder, your previous node will be preserved but will use different parameters.

General​

  • -e minima_clean=true : CAREFUL! Clears existing data, starts a new fresh node. All coins will be lost.
  • -e minima_host=ipaddress : specify the host IP
  • -e minima_dbpassword=yourdbpassword : Main Wallet / SQL AES password - MUST be specified on first launch. CANNOT be changed later.
  • -e minima_allowallip=true : Allow all IPs for Maxima / Networking. Local IPs won't be allowed otherwise.
  • -e minima_archive=true : Run an Archive node - store all archive data / the cascade to allow for resyncs from this node
  • -e minima_isclient=true : Tells the P2P System that this node can't accept incoming connections
  • -e minima_server=true : Use Server settings - this node can accept incoming connections
  • -e minima_desktop=true : Use Desktop settings - this node can't accept incoming connections
  • -e minima_connect=ip:port : Disable the automatic P2P system and create your own network by manually connecting to this list of host:port

MiniDapp System (mds)​

  • -e minima_mdsenable=true/false : enable the MiniDapp System (default port 9003). Enabled by default.
  • -e minima_mdspassword=yourmdspassword : specify the mds login password

RPC​

  • -e minima_rpcenable=true/false : enable remote procedure call. Disabled by default.
  • -e minima_rpcssl=true : use Self Signed SSL cert to run RPC
  • -e minima_rpcpassword=yourrpcpassword : set Basic Auth password for RPC calls ( Use with SSL / stunnel ). Only secure if used with SSL.
  • -e minima_rpcclrf=true : use CRLF at the end of the RPC headers (NodeJS)

Help​

  • -e minima_showparams=true : Show relevant startup params on launch
  • -e minima_help=true : print help for the start up parameters

VPS_startminima

  1. Ensure Docker starts up automatically when the server starts
sudo systemctl enable docker.service
sudo systemctl enable containerd.service

Congratulations! Your Node is up and running. Continue to install the Watchtower to automatically update Minima.

Automate updates with Watchtower​

  1. Start a Watchtower container to automatically update Minima when a new version is available.
docker run -d --restart unless-stopped --name watchtower -e WATCHTOWER_CLEANUP=true -e WATCHTOWER_TIMEOUT=60s -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower

Every 24 hours, the Watchtower will check whether there is a new version of Minima and will update if so.

VPS_startwatchtower

  1. Check that Minima and the Watchtower containers are running
docker ps -a

This will show all running and stopped (Exited) containers.

Next, access your MiniDapp hub and secure your node.

Login to your node​

The first time accessing your MiniDapp hub, you may need to pass through the security warning - see below - as the MiniDapp system uses self-signed certificates.

  1. Go to https://YourServerIP:9003/ in your web browser

Click on Advanced, then Proceed. Or in Google Chrome, you may have to click anywhere on the page and type thisisunsafe to proceed. Details for other browsers can be found here.

mds_login

  1. Enter your password to login, if you don't remember, you can check here.

You will see your MiniDapp hub!

Please see the first steps to complete now your node is running.

First steps​

The first time you install Minima, you will need to

  1. Connect to the network
  2. Write down your seed phrase

Please refer to the user guides to learn how.

FAQ​

Useful Docker commands​

The following commands can be run from your server command line, logged in as the minima user.

View the logs: docker logs minima9001

Stop Minima: docker stop minima9001

Remove your Minima container: docker rm minima9001

Start the Minima container: docker start minima9001

Restart the Minima container: docker restart minima9001

List all containers (Running and stopped): docker ps -a

List containers (Running only): docker ps

Stop containers listed: docker stop minima9001 minima8001 minima7001

Remove listed containers: docker rm minima9001 minima8001 minima7001

Help: docker --help


How to check your login password​

  1. Logon to your server as the minima user
  2. Access your docker container
docker exec -it minima9001 /bin/bash
  1. Edit the minima.config file
nano minima.config
  1. Scroll to the bottom of the file and add a new line, insert rpcenable=true.

Example:

data=/home/minima/data/.minima/
mdsenable=true
basefolder=/home/minima/data/
daemon=true
rpcenable=true
  1. Hold the ctrl+x buttons together to exit
  2. Save the file by selecting y, then press Enter
  3. Exit the container by typing
exit
  1. Restart the container
docker restart minima9001
  1. Now you can access your node's Terminal using
docker exec -it minima9001 minima

VPS_dockerterminal

The mds command will show details about the MiniDapp System (MDS) including your password and the MiniDapps installed on your node.

  1. Type mds to see your password

VPS_dockerterminal

note

RPC will be disabled the next time your docker container is updated to a new version, to enable RPC permanently, see How to enable RPC (advanced users)

Useful commands:
status - see the status of your node including version and chain details
help - show all commands


How to change your login password​

To change the password to login to your MiniDapp System (MDS), you must stop and remove your minima9001 container and restart it with a different password.

  1. Stop the minima9001 container
docker stop minima9001
  1. Remove the minima9001 container
docker rm minima9001
  1. Repeat step 10 from Start your node, with a different password. Your password should be at least 12 characters using alphanumeric characters and symbols.
important

Deleting the container will not delete the minimadocker9001 data folder so your coins will be safe during this process.

When starting the new container, you must use the same minimadocker9001 folder to ensure your coins and data are restored.


How to start a second node in Docker​

To run a second node in Docker, you can create another container using different port numbers, file path and name.

  1. To create a node on port 8001:
docker run -d -e minima_mdspassword=INSERTPASSWORD -e minima_server=true -v ~/minimadocker8001:/home/minima/data -p 8001-9003:9001-9003 --restart unless-stopped --name minima8001 minimaglobal/minima:latest

To login to your node, go to https://YourServerIP:8003/


How to start a test node as a developer​

To create a private test node from Genesis on ports 10001-10003, use the following start up command.

docker run -d -e minima_mdspassword=INSERTPASSWORD -e minima_server=true -e minima_genesis=true -e minima_test=true -e minima_nop2p=true -v ~/minimadocker10001_dev:/home/minima/data -p 10001-10003:9001-9003 --restart unless-stopped --name minima10001_dev minimaglobal/minima:latest
Test parameters
The additional test parameters used are:

-p 10001-10003:9001-9003 : Local ports 10001-10003 will be forwarded to 9001-9003 on Docker.
You can change 10001-10003 to another set of unused ports however the Docker ports must remain as 9001-9003.

-e minima_genesis=true : Start a node from the Genesis block

-e minima_test=true : Use test parameters e.g. blocks are automined and block times are faster

-e minima_nop2p=true : Do not start the p2p system

How to enable RPC (advanced users)​

warning

Only enable RPC if you understand the risks and have appropriate firewalls in place to prevent unauthorised access to your node!

If enabling RPC by opening the 9005 port, use the following additional parameters and set an RPC password for connecting over RPC on the start up line. You will only be able to use RPC commands if SSH'd into the server.

-e minima_rpcpassword=INSERTRPCPASSWORD -p 9001-9003:9001-9003 -p 127.0.0.1:9005:9005

Example:

docker run -d -e minima_mdspassword=INSERTPASSWORD -e minima_rpcpassword=INSERTRPCPASSWORD -e minima_server=true -v ~/minimadocker9001:/home/minima/data -p 9001-9003:9001-9003 -p 127.0.0.1:9005:9005 --restart unless-stopped --name minima9001 minimaglobal/minima:latest

On a second node running on ports 8001-8005, this would be:

docker run -d -e minima_mdspassword=INSERTPASSWORD -e minima_rpcpassword=INSERTRPCPASSWORD -e minima_server=true -v ~/minimadocker8001:/home/minima/data -p 8001-9003:9001-9003 -p 127.0.0.1:8005:9005 --restart unless-stopped --name minima8001 minimaglobal/minima:latest

RPC commands​

By default Minima is installed on ports 9001-9005. The default RPC port is 9005.

You can send commands to your Minima node using curl to the RPC port.

To install curl: sudo apt install curl then y

For improved formatting: sudo apt install jq then y

Example:

To check the status of your Minima node when logged on to the server:

curl -k -u minima:INSERTRPCPASSWORD 127.0.0.1:9005/status | jq

You will see the current block and other information about your node.

To show the full list of commands:

curl -k -u minima:INSERTRPCPASSWORD 127.0.0.1:9005/help | jq

However, if you wish to check your node from an external computer, you must use SSH with each command.

ssh root@YourServerIP curl -k -u minima:INSERTRPCPASSWORD 127.0.0.1:9005/status

Each request will also require your server password.

Using the Docker CLI​

To use your Docker CLI, you must add your RPC password:

docker exec -it minima9001 minima -password YOURRPCPASSWORD

How to remove a node​

important

Removing a node without taking a backup will delete all your coins! Only remove a node if you have taken a backup or are running a test node.

To remove a Docker node:

  1. Login as the minima user to your server
  2. Stop then delete the minima9001 container
docker stop minima9001
docker rm minima9001
  1. Delete the minimadocker9001 folder from your home directory by running
sudo rm -rf minimadocker9001

Need help?​

For help and support, find us in Discord or Telegram.