You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+77Lines changed: 77 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,3 +98,80 @@ There are two options when using the Avalanche-CLI:
98
98
99
99
1. Use an official Subnet-EVM release: https://docs.avax.network/subnets/build-first-subnet
100
100
2. Build and deploy a locally built (and optionally modified) version of Subnet-EVM: https://docs.avax.network/subnets/create-custom-subnet
101
+
102
+
## Run in Docker
103
+
104
+
### Configuration
105
+
106
+
You can configure the `subnet-evm` Docker container using both environment variables and standard AvalancheGo config files.
107
+
108
+
-**Environment Variables**: Use uppercase variables prefixed with `AVAGO_`. For example, `AVAGO_NETWORK_ID` corresponds to the `--network-id` flag in AvalancheGo.
109
+
-**Config Files**: Configure as you would with the regular AvalancheGo binary using config files. Ensure `HOME` is set to `/home/avalanche` and mount the config directory with `-v ~/.avalanchego:/home/avalanche/.avalanchego`.
110
+
111
+
### Data Persistence
112
+
113
+
To persist data across container restarts, you need to mount the `.avalanchego` directory.
114
+
115
+
-**Create Directory**: Run `mkdir -p ~/.avalanchego/staking` beforehand to create the necessary directories and avoid file system access issues.
116
+
-**Set Permissions**: Run the container with `--user $(id -u):$(id -g)` to ensure proper access rights.
117
+
-**Set Home and Mount**: Set `HOME` to `/home/avalanche` and mount the data directory with `-v ~/.avalanchego:/home/avalanche/.avalanchego`.
118
+
119
+
### Updating
120
+
121
+
Run `docker stop avago; docker rm avago;` then start a new container with the latest version tag in your `docker run` command.
122
+
123
+
### Networking
124
+
125
+
Using `--network host` is recommended to avoid any issues.
126
+
127
+
If you know what you are doing, you will need port `AVAGO_STAKING_PORT` (default `9651`) open for the validator to connect to the subnet. For the RPC server, open `AVAGO_HTTP_PORT` (default `9650`). Do not attempt to remap `AVAGO_STAKING_PORT` using the Docker `-p` flag (e.g., `-p 9651:1234`); it will not work. Instead, set `AVAGO_STAKING_PORT=1234` and then use `-p 1234:1234`.
128
+
129
+
### Example Configs
130
+
131
+
#### Fuji Subnet Validator
132
+
133
+
```bash
134
+
mkdir -p ~/.avalanchego/staking; docker run -it -d \
-`AVAGO_STAKING_PORT` is set to `9653` in case you want to run this on the same machine as the validator.
176
+
-`AVAGO_HTTP_PORT` is set to `8080` instead of `9650` to avoid conflicts with the validator.
177
+
-`AVAGO_HTTP_ALLOWED_HOSTS` and `AVAGO_HTTP_HOST` are required to allow the RPC server to be accessed from outside. You'll need to secure it with HTTPS; Caddy is recommended.
0 commit comments