Installing from Source
A step-by-step guide on how to prepare a fully-functional Production environment from source.
Success
If you plan on using Core V3 for testing or development, consider setting up a Development environment by Using the Install Script.
Success
If you don’t have access to a Linux box you can quickly setup one on DigitalOcean and other cloud providers.
Introduction
This guide will take you through the basic steps of setting up a development environment from scratch on a fresh Ubuntu 24.04 LTS or Ubuntu 26.04 LTS server. Other distributions may work, but are not officially supported.
Step 1: User setup
We will create a new user ark and add this user to the sudoers group (allowing root execution if needed). You can skip this step as a developer and continue to next steps below.
If you are running on a fresh cloud box, like for example DigitalOcean , then create a user with the following commands below.
1# Create the user (example: 'ark')2sudo adduser ark3sudo usermod -aG sudo ark4 5# Login as the newly user6sudo su - ark
Step 2: Install Git Source Control System
As the most popular version control software in existence, Git is a staple of many developer workflows, and ARK is no exception. Downloading Git will allow you to clone the latest version of ARK Core.
1sudo apt-get update2sudo apt-get install -y git curl ca-certificates gnupg
Step 3: Install Node.js Runtime
As ARK Core is written exclusively in Node.js , the server-side framework for JavaScript, Typescript, installing Node.js is a necessity for core development. The code below installs Node.js 24 from the NodeSource repository.
1curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/nodesource.gpg > /dev/null2echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_24.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list3echo -e "Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 999" | sudo tee /etc/apt/preferences.d/nodesource4sudo apt-get update5sudo apt-get install -y nodejs
Information
apt-key is deprecated and no longer available on recent Ubuntu releases. Repository keys are stored in /usr/share/keyrings and referenced with signed-by instead. The pin makes sure the NodeSource package is preferred over the older nodejs package that ships with Ubuntu.
Step 4: Install Yarn Package Manager
Yarn is a package manager that seeks to build upon the foundation of Node’s npm. Most ARK developers use yarn, and as such, you will see yarn commands often used throughout our documentation.
The Core repository is a Yarn 1 (classic) workspace. Install it from the Yarn apt repository, the same way the install script does:
1curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg > /dev/null2echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list3sudo apt-get update4sudo apt-get install -y yarn
Step 5: Install Dependencies
Dependencies are needed for core to be compiled, run and controlled while living inside you linux based environment. To command below installs some of those needed dependencies that are used by core or related scripts.
1sudo apt-get install -y build-essential python-is-python3 python3-setuptools pkg-config libtool autoconf automake libpq-dev jq libjemalloc-dev
Step 6: Clone The Core Repository
Let’s clone our core repository and run the initial yarn setup command. We will also checkout the latest develop branch.
yarn setup command leverages Lerna to clean, bootstrap and build the core packages (including transpiling typescript). For mode information look into core’s package.json file in the root folder.
1git clone https://github.com/arkecosystem/core2cd core3git checkout develop4yarn setup #run Lerna to clean, bootstrap and build the core packages
Step 7: Setting Up The Development Database
ARK Core stores all the blockchain data in a PostgreSQL database. You have two options on how to setup your development database.
Information
Follow Step 7.1 if you are working locally on your developer computer and have docker environment in place, otherwise follow Step 7.2 (for example if you are running on a cloud based Ubuntu instance or prefer native database install).
Step 7.1 Database Setup Using Docker
If you are already using Docker with the docker compose plugin installed, then you can generate docker files from the command line, with the yarn docker ark command where (ark is the name of the network for which you want to generate docker files). For now let’s stick with ark as the default name of the network.
Executing the command yarn docker ark in the root folder of the previously cloned repository, like this:
1cd core #root folder of the cloned repository2yarn docker ark
will generate the following docker files inside our core/docker folder (see folder tree below):
1#core/docker tree in the cloned repository folder 2├── development 3│ ├── devnet 4│ │ ├── Dockerfile 5│ │ ├── docker-compose.yml 6│ │ ├── entrypoint.sh 7│ │ ├── purge_all.sh 8│ │ └── restore.sh 9│ ├── mainnet10│ │ └── docker-compose.yml11│ ├── testnet #this is the folder where we will start our PostgreSQL testnet DB12│ │ ├── Dockerfile13│ │ ├── docker-compose.yml14│ │ ├── entrypoint.sh15│ │ ├── purge_all.sh16│ │ └── restore.sh17│ └── unitnet18│ ├── docker-compose.yml19│ └── purge.sh20└── production21...
To start the PostgreSQL docker container we must go into the corresponding folder and run the docker compose command. For testnet we need to run the following:
1cd docker/development/testnet2docker compose up -d postgres #postgres is the name of the PostgreSQL container
The docker compose up -d postgres command will start PostgresSQL container and expose it to our core via standard PostgreSQL port 5432.
Step 7.2 Installing Postgres Database System-Wide
If you don’t want to install and run docker on your local computer you can still install PostgreSQL database natively on your running operating system. We recommend PostgreSQL 18 from the official PostgreSQL apt repository , which is also what the install script uses:
1curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /usr/share/keyrings/pgdg.gpg > /dev/null2echo "deb [signed-by=/usr/share/keyrings/pgdg.gpg] https://apt.postgresql.org/pub/repos/apt $(. /etc/os-release && echo "$VERSION_CODENAME")-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list3sudo apt-get update4sudo apt-get install -y postgresql-185sudo -i -u postgres psql -c "CREATE USER ark WITH PASSWORD 'password' CREATEDB;"6sudo -i -u postgres psql -c "CREATE DATABASE ark_testnet WITH OWNER ark;"7sudo -i -u postgres psql -c "CREATE DATABASE ark_devnet WITH OWNER ark;"
The commands above install PostgreSQL database locally and create databases for running testnet and devnet networks with user ark as the database owner. If you have skipped the Step 1: User setup, you have to change ark user to your development username, usually the logged in username.
Warning
Replace password with a strong password of your own on any server that is reachable from the internet.
Start Core and Play With Public API
You can jump to Spinning Up Your First Testnet Section here and test your local Core Server, by following the link below: