This tutorial runs an OP Stack node using the official op-reth and op-node Docker images in a singleDocumentation Index
Fetch the complete documentation index at: https://docs.optimism.io/llms.txt
Use this file to discover all available pages before exploring further.
docker-compose.yml. No source build required.
Dependencies
- Docker
- Docker Compose (v2)
- An L1 execution RPC endpoint (Ethereum mainnet for OP Mainnet, or Ethereum Sepolia for OP Sepolia).
- An L1 Beacon API endpoint for the same L1 chain. Needed by op-node to fetch blob data post-Ecotone.
Quick start
Create the .env file
Configure your network and L1 endpoints. Pick one network block (Sepolia or Mainnet) and fill in your L1 RPC + Beacon URLs:
L1_RPC_KIND valid values: alchemy, quicknode, infura, parity, nethermind, debug_geth, erigon, basic, any. Use basic if unsure.OP_RETH_CHAIN and OP_NODE_NETWORK accept any superchain-registry chain (e.g. unichain / unichain-mainnet, soneium / soneium-mainnet). For each chain, point L1_RPC_URL / L1_BEACON_URL at the corresponding L1 (Ethereum Mainnet or Sepolia) and update OP_RETH_SEQUENCER to that chain’s sequencer endpoint.Create docker-compose.yml
./reth-data on the host so you can inspect / restore from a snapshot directly (see Bootstrap from a snapshot below).Image tags shown are the latest as of writing. For the current tags, see the op-reth releases and op-node releases.Verification
Check the node is alive and advancing:{"jsonrpc":"2.0","id":1,"result":"0x..."} with the current block in hex. Run again after a minute — the number should increase as sync progresses.
For op-node sync status (unsafe, safe, and finalized heads in one call):
During the initial EL-driven sync (
--syncmode=execution-layer), unsafe_l2 tracks the tip via libp2p gossip while safe_l2 and finalized_l2 stay at 0. This is expected — op-node defers L1 derivation until op-reth finishes its staged sync. Once the EL catches up, derivation begins and the safe/finalized heads start advancing.Bootstrap from a snapshot
Syncing from scratch is fine for OP Sepolia (~30–50 GB, hours) but slow for OP Mainnet (~700 GB, days). For Mainnet — or anytime you’d rather skip the initial sync — bootstrap op-reth from a pre-synced snapshot.For OP Mainnet, a snapshot also handles the pre-Bedrock state requirement (see the warning at the top of this page) in one step.
Download a snapshot
Browse datadirs.optimism.io for the snapshot matching your network and pick a recent file. Then download and verify the SHA256:
Extract into the datadir
The bind-mounted directory is
./reth-data (relative to your docker-compose.yml):--strip-components=1 removes the top-level wrapping directory inside the tarball. Run tar -tf <snapshot-file>.tar.zst | head -3 first to confirm — if files are already at the archive root, omit --strip-components.Next steps
- Node Metrics and Monitoring Guide — wire up Prometheus/Grafana against the metrics port.
- Node Troubleshooting Guide — if you run into problems.
- Building and running an OP Stack node from source — if you need a custom build or want to inspect the source.