Ubuntu 16.04 (LTS) x86_64
Ubuntu 18.04 (LTS) x86_64
MacOS 10.13 (High Sierra)
MacOS 10.14 (Mojave)
The following dependencies need to be installed in order to run applications created with the Lisk SDK:
To install the required prerequisites, it is necessary to have a user with sudo rights on the server.
To run and manage a node in the future, please create a separate
sudo adduser lisk
It is not essentially needed to set up a
lisk user, especially when you are running a local instance for development purposes.
If you still want to do it, we recommend to create the user using the macOS GUI: https://support.apple.com/en-gb/guide/mac-help/mtusr001/mac
Used for compiling dependencies.
To install PostgreSQL follow the intructions descibed below, depending on the operating system your machine is running on.
Two different ways of installing Docker on your system are described below. If you run into issues when trying to set up PostgreSQL on your machine, try to install it inside of a docker container.
|We recommend using PostgreSQL with Docker for a quick and straight forward setup of PostgreSQL, and PostgreSQL system-wide for production environments.|
|See intructions for MacOS below.|
Firstly, install postgreSQL on your machine:
sudo apt-get purge -y postgres* (1) sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' sudo apt install wget ca-certificates wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo apt update sudo apt install postgresql-10
|1||remove all already installed postgres versions|
After installation, you should see the PostgreSQL database cluster, by running
Drop the existing database cluster, and replace it with a cluster with the locale
sudo pg_dropcluster --stop 10 main sudo pg_createcluster --locale en_US.UTF-8 --start 10 main
Create a new database user called
lisk and grant it rights to create databases.
Then create the database with the lisk user as owner.
In the last step, define the password for the lisk user:
sudo -u postgres -i createuser --createdb lisk sudo -u postgres -i createdb lisk_dev --owner lisk sudo -u postgres psql -d lisk_dev -c "alter user lisk with password 'password';"
Install PostgreSQL version 10:
brew install postgresql@10
Execute the following to have PostgreSQL commands (e.g.
psql) in your PATH:
echo 'export PATH="/usr/local/opt/postgresql@10/bin:$PATH"' >> ~/.bash_profile source ~/.bash_profile
Start PostgreSQL, create the
lisk user and the database:
pg_ctl -D /usr/local/var/postgresql@10 start createuser lisk createdb --owner=lisk lisk_dev psql --dbname=lisk_dev --command="ALTER USER lisk WITH PASSWORD 'password';"
Running PostgreSQL inside a Docker container will setup the correct version of PostgreSQL and containerize it away from any existing versions you may have locally on your machine. Choose this setup if you are not familiar with PostgreSQL, or if you run in to issues with a previously installed version of PostgreSQL.
To perform the command below successfully, install Docker first:
Supported Platforms: Please refer to https://docs.docker.com/engine/installation/#desktop
Mac OS X
Please refer to https://docs.docker.com/engine/installation/#server
Start the Docker container
|If you have other versions of PostgreSQL installed on your machine, make sure to stop them before starting the docker container.|
docker run --name lisk_db -p 5432:5432 -e POSTGRES_USER=lisk -e POSTGRES_PASSWORD=password -e POSTGRES_DB=lisk_<NETWORK> -d postgres:10
This will install PostgreSQL version 10 (
postgres:10) in a container with name
lisk_db and binds the port
5432 of the container with the same port of the machine.
As environment variables we expose
POSTGRES_USER=lisk to create the lisk user and
POSTGRES_PASSWORD=password to set the password for the lisk user.
Finally the environment variable
POSTGRES_DB creates the database
lisk_<NETWORK> with the
lisk user as owner.
The above should be enough to set up the database ready to use with the Lisk SDK. To manage the Docker container, use the following commands:
docker stop lisk_db (1) docker start lisk_db (2) docker restart lisk_db (3) docker rm lisk_db (4)
|1||stop the container|
|2||start the container|
|3||restart the container|
|4||remove the container|
In case you want to access PostgreSQL inside the container via CLI, run:
docker exec --tty --interactive lisk_db psql -h localhost -U lisk -d postgres
Node.js serves as the underlying engine for code execution. There are several different ways and version managers to install Node.JS on your system. We recommend one of the following two:
We recommend using a Node version manager such as NVM. NVM is a bash script that enables you to manage multiple active Node.js versions.
Install nvm following these instructions
Install the correct version of Node.js using NVM:
nvm install 10.15.3
If you do not want to use NVM or other package managers, you can install the Node package globally on your system alternatively:
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt-get install -y nodejs
brew install firstname.lastname@example.org
Install PM2 for managing start/stop of the app process in the background:
npm install pm2 -g
To install the NPM package lisk-sdk, run:
npm install lisk-sdk