This guide explains step-by-step how to set up a zkSync Era
node on Ubuntu Linux.
- CPU: A relatively modern CPU is recommended.
- RAM: 32 GB
- Storage: 300 GB, with the state growing about 1TB per month.
- Network: 100 Mbps connection (1 Gbps+ recommended)
If you need a server, you can rent one from Hetzner. Additionally, if you sign up using this referral link, you will receive a 20 EUR credit.
-
Download and Install Visual Studio Code: Visual Studio Code Download Page
- Once downloaded, follow the installation wizard to install Visual Studio Code.
-
Install the SSH Extension:
- Open Visual Studio Code.
- Click on the
Extensions
icon in the left sidebar. - Type
Remote - SSH
in the search bar and install the extension developed by Microsoft.
-
Connect to SSH in Visual Studio Code:
- Press
Ctrl+Shift+P
in Visual Studio Code and selectRemote-SSH: Connect to Host...
. - Enter your server address in the format
ssh root@ip_address
. - Enter your password or SSH key to complete the connection.
Note: Replace
ip_address
with the actual IP address of your server. - Press
-
Verify the Connection:
- If the connection is successful, the name of the connected server will appear in the lower-left corner of the Visual Studio Code window.
-
Open the Terminal:
- After connecting to the server in Visual Studio Code, you can open the terminal by clicking on
Terminal
>New Terminal
in the top menu. - Alternatively, you can open the terminal by pressing
Ctrl+
(Control key and the backtick key, located below the ESC key).
- After connecting to the server in Visual Studio Code, you can open the terminal by clicking on
After successfully connecting to the server, execute these commands on the server.
-
Update System Packages:
sudo apt update
-
Install Docker:
sudo apt install docker.io
-
Verify Docker Service is Running:
sudo systemctl status docker
-
Verify Docker Installation:
docker --version
-
Download Docker Compose:
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
-
Give Execute Permission to Docker Compose:
sudo chmod +x /usr/local/bin/docker-compose
-
Verify Installation:
docker-compose --version
-
Install Git (if not already installed):
sudo apt install git
-
Clone the Repository:
git clone https://github.com/matter-labs/zksync-era.git
-
Navigate to the Cloned Directories:
cd zksync-era/docs/guides/external-node cd docker-compose-examples
-
Start the Node Using Docker Compose:
docker-compose -f mainnet-external-node-docker-compose.yml up -d
-
Verify Running Containers:
docker ps
This command lists currently running Docker containers. You should see the containers related to the
zkSync Era
node. -
View and Follow the Last 100 Logs:
docker logs -f --tail 100 docker-compose-examples_external-node_1
Press Ctrl+C
to exit the log view. This will not stop your node; it will continue to run in the background.
After running Docker, you can access a dashboard on port 3000. To view this dashboard from your local computer, you need to set up port forwarding in Visual Studio Code.
-
Set Up Port Forwarding:
- Press
Ctrl+Shift+P
to open the command palette. - Type
Forward a Port
and select the option. - Enter
3000
for the port number and press Enter.
Alternatively:
- Click on the
PORTS
section in the bottom right corner of Visual Studio Code. - Select
Forward Port...
from the menu. - Enter
3000
for the port number and press Enter.
- Press
-
Access the Dashboard:
- Open your web browser and go to
http://localhost:3000/d/0/external-node
. - You should now have access to the dashboard.
- Open your web browser and go to
This step allows you to easily view the dashboard of the application running on your remote server from your local computer.
-
View Container Logs:
docker logs <container_id>
-
Stop the Node:
docker-compose -f mainnet-external-node-docker-compose.yml down