Step 1 of 5: This tutorial is designed to be followed step-by-step. Each step builds on the previous one.
Quick Setup AvailableFor a complete automated setup that includes op-deployer deployment, check out the
code/ directory. The automated setup handles all contract deployment and configuration automatically.About op-deployer
op-deployer simplifies the process of deploying the OP Stack. You define a declarative config file called an “intent,” then run a command to apply it. op-deployer compares your chain’s current state against the intent and makes the necessary changes to match.
Installation
There are a couple of ways to installop-deployer:
- Use binary
- Build from source
The recommended way to install Your directory structure will now look like this:
op-deployer is to download the latest release from the monorepo’s release page.Quick Setup AvailableFor automated installation, you can use the download script from the code directory. This script automatically downloads the latest version for your system.
1
Download the correct binary
- Go to the release page
- Find the latest release that includes
op-deployer(look for releases tagged withop-deployer/v*) - Under assets, download the binary that matches your system:
- For Linux:
op-deployer-linux-amd64 - For macOS:
- Apple Silicon (M1/M2):
op-deployer-darwin-arm64 - Intel processors:
op-deployer-darwin-amd64
- Apple Silicon (M1/M2):
- For Windows:
op-deployer-windows-amd64.exe
Always download the latest version to ensure you have the most recent features and bug fixes.
Not sure which macOS version to use?
- Open Terminal and run
uname -m - If it shows
arm64, use the arm64 version - If it shows
x86_64, use the amd64 version
2
Create deployer directory and install binary
- Create the rollup directory structure and enter the deployer directory:
- Move and rename the downloaded binary:
The downloaded file is likely in your Downloads folder:
- macOS/Linux:
/Users/YOUR_USERNAME/Downloads - Windows WSL:
/mnt/c/Users/YOUR_USERNAME/Downloads
Pro Tip: Use the automated download script from the code directory to avoid manual version management. It automatically detects your platform and downloads the latest version.
L1 network requirements
Before deploying your L1 contracts, you’ll need: L1 RPC URL: An Ethereum RPC endpoint for your chosen L1 networkGenerate deployment addresses
Your rollup needs several addresses for different roles. Let’s generate them first:1
Create address directory
2
Generate address for each role
cat *_address.txt.Important:
- Save these address - you’ll need them to operate your chain
- You can use any address for the purpose of testing, for production, use proper key management solutions (HSMs, multisigs addresses)
Create and configure intent file
The intent file defines your chain’s configuration.1
Initialize intent file
Inside the
deployer folder, run this command:Understanding intent types
Understanding intent types
op-deployer supports three intent types:standard: Uses default OP Stack configuration, minimal customizationstandard-overrides: Recommended. Uses defaults but allows overriding specific valuescustom: Full customization, requires manual configuration of all values
standard-overrides provides the best balance of simplicity and flexibility.2
Update the intent file
Edit
.deployer/intent.toml with your generated addresses. The op-deployer init command automatically populates this file with sensible defaults. Update the addresses while keeping the auto-generated contract locator values:Understanding the configuration values
Understanding the configuration values
Global Settings:
l1ChainID: The L1 network ID (11155111 for Sepolia)fundDevAccounts: Creates test accounts with ETH if true (set to false for production)useInterop: Enable interoperability features (false for standard deployments)opcmAddress: OP Contracts Manager (OPCM) contract address on the L1 network (automatically populated for supported networks)
op-deployer init with default values compatible with your op-deployer version.
Removing them will cause the error: “Application failed: L1ContractsLocator undefined”.
Keep the auto-generated values unless you specifically need different contract versions.
For version compatibility details, see the op-deployer release notes.Shared Contract Roles (Advanced):These are commented out because for standard OP Stack deployments, shared contract roles are predefined by the protocol. Only uncomment and define custom roles if you’re creating a standalone chain not part of the OP Stack ecosystem.Chain Configuration:id: Unique identifier for your chain*FeeVaultRecipient: Addresses receiving protocol fees (required — deployment fails if any are set to the zero address). See fee vaults for details on each vault.eip1559*: Parameters for dynamic gas price calculation
Chain Roles:
l1ProxyAdminOwner: Can upgrade L1 contract implementations (usually same as superchain proxyAdminOwner)l2ProxyAdminOwner: Can upgrade L2 contract implementationssystemConfigOwner: Manages system configuration parametersunsafeBlockSigner: Signs pre-confirmation blocks (can be same as batcher)batcher: Submits L2 transaction batches to L1proposer: Submits L2 state roots to L1 for verificationchallenger: Monitors dispute games and defends valid states
Replace all
0x... with actual addresses from your addresses.txt file.
Never use the default test mnemonic addresses in production or public testnets!Create environment file
Before deploying, create a.env file in your deployer directory to store your environment variables:
Never commit your
.env file to version control. Add it to your .gitignore:Deploy L1 Contracts
Now that your intent file and environment variables are configured, let’s deploy the L1 contracts:- Deploy all required L1 contracts
- Configure them according to your intent file
- Save deployment information to
.deployer/state.json
The deployment can take 10-15 seconds and requires multiple transactions.
Generate chain configuration
After successful deployment, generate your chain configuration files:What’s Next?
Great! You’ve successfully:- Installed
op-deployerusing theinitandapplycommand. - Created and configured your intent file
- Deployed L1 smart contracts
- Generated chain artifacts
Spin up sequencer →
Next: Set up op-reth and op-node, essential building blocks of the execution and consensus layers in your rollup.
Need Help?
- op-deployer Documentation: op-deployer overview
- op-deployer Repository: GitHub
- OPCM Documentation: OP Contracts Manager
- Support: Open an issue in the Optimism monorepo