Run BSC Nodes Using Docker

·

Introduction

Running a Binance Smart Chain (BSC) full node via Docker simplifies deployment while maintaining blockchain integrity. This guide covers setup, configuration, and monitoring for Mac OS X, Linux, and Windows.


Prerequisites


Step 1: Install Docker

For Desktop Users

Download Docker Desktop for your OS:

For Ubuntu Linux

Run these commands:

sudo apt-get update  
sudo apt-get install docker-ce docker-ce-cli containerd.io  

Post-Install Configuration

Enable Docker on startup:

sudo systemctl enable docker.service  
sudo systemctl enable containerd.service  

Grant user permissions:

sudo usermod -aG docker $USER  

Step 2: Pull BSC Docker Image

Fetch the latest BSC image:

docker pull ghcr.io/bnb-chain/bsc:latest  

👉 Explore BSC Docker Hub for version details.


Step 3: Download Configuration Files

Mainnet

wget $(curl -s https://api.github.com/repos/bnb-chain/bsc/releases/latest | grep browser_ | grep mainnet | cut -d\" -f4)  
unzip mainnet.zip  

Testnet

wget $(curl -s https://api.github.com/repos/bnb-chain/bsc/releases/latest | grep browser_ | grep testnet | cut -d\" -f4)  
unzip testnet.zip  

Step 4: Run Docker Container

Directory Structure

| Local Path | Docker Path | Purpose |
|------------------|------------------|-----------------------|
| ./config | /bsc/config | Config files |
| ./data/node | /bsc/node | Blockchain data |

Start Container

docker run -v $(pwd)/config:/bsc/config -v $(pwd)/data/node:/bsc/node -p 8545:8545 --name bsc-node -it ghcr.io/bnb-chain/bsc:latest --http.addr 0.0.0.0  

Flags Explained:

👉 Troubleshooting Tips for common issues.


Step 5: Monitor Node Status

Check Sync Status

Attach Geth console:

geth attach http://localhost:8545  

Run:

eth.syncing  

View Logs

docker logs bsc-node --tail 100  

FAQ

1. How long does initial sync take?

~48 hours with a fast SSD and stable internet.

2. Can I run a node on Windows?

Yes, but Linux is preferred for performance.

3. What’s the default RPC port?

4. How to update the BSC image?

Stop the container and re-run docker pull ghcr.io/bnb-chain/bsc:latest.


Conclusion

Deploying a BSC node with Docker ensures scalability and ease of maintenance. Follow best practices for security, like restricting RPC access.

For advanced configurations, visit BSC official docs.