description: Run Pantheon using the official docker image # Running Pantheon from Docker Image A Docker image is provided to run a Pantheon node in a Docker container. Use this Docker image to run a single Pantheon node without installing Pantheon. !!!caution If you have been running a node using the v0.8.3 Docker image, the node was not saving data to the specified [data directory](#data-directory), or referring to the custom [configuration file](#custom-configuration-file) or [genesis file](#custom-genesis-file). To recover the node key and data directory from the Docker container: `docker cp :/opt/pantheon/key ` `docker cp :/opt/pantheon/database ` Where `container` is the name or ID of the Docker container containing the Pantheon node. The container can be running or stopped when you copy the key and data directory. If your node was fully synchronized to MainNet, the data directory will be ~2TB. When restarting your node with the v0.8.4 Docker image: * Save the node key in the [`key` file](../Configuring-Pantheon/Node-Keys.md#node-private-key) in the data directory or specify the location using the [`--node-private-key` option](../Configuring-Pantheon/Node-Keys.md#specifying-a-custom-node-private-key-file). * Specify the `,target=/var/lib/pantheon pegasyseng/pantheon:latest ``` Where `` is the volume to which the data is saved. ### Custom Configuration File Specify a [custom configuration file](../Configuring-Pantheon/Using-Configuration-File.md) to provide a file containing key/value pairs for command line options. This is the equivalent of specifying the [`--config-file`](../Reference/Pantheon-CLI-Syntax.md#config-file) option. To run Pantheon specifying a custom configuration file: ```bash docker run --mount type=bind,source=/,target=/etc/pantheon/pantheon.conf pegasyseng/pantheon:latest ``` Where `myconf.toml` is your custom configuration file and `path` is the absolute path to the file. !!!example ```bash docker run --mount type=bind,source=/Users/username/pantheon/myconf.toml,target=/etc/pantheon/pantheon.conf pegasyseng/pantheon:latest ``` ### Custom Genesis File Specify a custom genesis file to configure the blockchain. This is equivalent to specifying the `--genesis-file` option. To run Pantheon specifying a custom genesis file: ```bash docker run --mount type=bind,source=,target=/etc/pantheon/genesis.json pegasyseng/pantheon:latest ``` Where `mygenesis.json` is your custom configuration file and `path` is the absolute path to the file. !!!example ```bash docker run --mount type=bind,source=/Users/username/pantheon/mygenesis.json,target=/etc/pantheon/genesis.json pegasyseng/pantheon:latest ``` ### Exposing Ports Expose ports for P2P peer discovery, metrics, and HTTP and WebSockets JSON-RPC. This is required to use the defaults ports or specify different ports (the equivalent of specifying the [`--rpc-http-port`](../Reference/Pantheon-CLI-Syntax.md#rpc-http-port), [`--p2p-port`](../Reference/Pantheon-CLI-Syntax.md#p2p-port), [`--rpc-ws-port`](../Reference/Pantheon-CLI-Syntax.md#rpc-ws-port), [`--metrics-port`](../Reference/Pantheon-CLI-Syntax.md#metrics-port), and [`--metrics-push-port`](../Reference/Pantheon-CLI-Syntax.md#metrics-push-port) options). To run Pantheon exposing local ports for access: ```bash $ docker run -p :8545 -p :8546 -p :30303 pegasyseng/pantheon:latest --rpc-http-enabled --rpc-ws-enabled ``` !!!example To enable RPC calls to http://127.0.0.1:8545 and P2P discovery on http://127.0.0.1:13001: ```bash docker run -p 8545:8545 -p 13001:30303 pegasyseng/pantheon:latest --rpc-http-enabled ``` ## Starting Pantheon ### Run a Node on Ethereum Mainnet To run a node on the Ethereum mainnet: ```bash docker run -p 30303:30303 --mount type=bind,source=/,target=/var/lib/pantheon pegasyseng/pantheon:latest ``` To run a node on mainnet with the HTTP JSON-RPC service enabled: ```bash docker run -p 8545:8545 -p 30303:30303 --mount type=bind,source=/,target=/var/lib/pantheon pegasyseng/pantheon:latest --rpc-http-enabled ``` ## Run a Node on Ropsten Testnet To run a node on Ropsten: ```bash docker run -p 30303:30303 --mount type=bind,source=/,target=/var/lib/pantheon --network=ropsten ``` ## Run a Node on Rinkeby Testnet To run a node on Rinkeby: ```bash docker run -p 30303:30303 --mount type=bind,source=/,target=/var/lib/pantheon pegasyseng/pantheon:latest --network=rinkeby ``` ## Run a Node for Testing To run a node that mines blocks at a rate suitable for testing purposes with WebSockets enabled: ```bash docker run -p 8546:8546 --mount type=bind,source=/,target=/var/lib/pantheon pegasyseng/pantheon:latest --miner-enabled --miner-coinbase fe3b557e8fb62b89f4916b721be55ceb828dbd73 --rpc-http-cors-origins="all" --rpc-ws-enabled --network=dev ``` ## Stopping Pantheon and Cleaning up Resources When you're done running nodes, you can shut down the node container without deleting resources. Alternatively, you can delete the container (after stopping it) and its associated volume. Run `docker container ls` and `docker volume ls` to obtain the container and volume names. Then run the following commands: To stop a container: ```bash docker stop ``` To delete a container: ```bash docker rm ``` To delete a container volume (optional): ```bash docker volume rm ```