A Docker container for the Solana CLI and spl-token — easily manage your Solana coins and tokens without installing anything locally.
- Solana CLI (
solana) in a container — no local installation needed - SPL Token CLI (
spl-token) for managing tokens - Easy wallet mounting via Docker volumes
- Weekly automated rebuilds (Debian security patches + dependency updates)
- Build ARG for pinning a specific Solana version
Note: This image uses the Agave installer — the actively maintained fork of
solana-labs/solana, which was archived in January 2025. The CLI tool names (solana,solana-keygen,spl-token) remain unchanged.
How to create a token/coin:
docker run -it --rm andreaskasper/solana:cli solana-keygen new
⚠️ Write down your seed phrase and store it safely! Without it, you cannot recover your wallet.
docker run -it --rm \
-v ${PWD}/id.json:/root/.config/solana/id.json:ro \
andreaskasper/solana:cli solana balance# List all token accounts
docker run -it --rm \
-v ${PWD}/id.json:/root/.config/solana/id.json:ro \
andreaskasper/solana:cli spl-token accounts
# Create a new token
docker run -it --rm \
-v ${PWD}/id.json:/root/.config/solana/id.json:ro \
andreaskasper/solana:cli spl-token create-tokendocker run -it --rm \
-v ${PWD}/id.json:/root/.config/solana/id.json:ro \
andreaskasper/solana:cli bashA convenient way to run repeated commands with a persistent wallet:
version: "3.8"
services:
solana:
image: andreaskasper/solana:cli
# Mount your wallet file (read-only is recommended for safety)
volumes:
- ./id.json:/root/.config/solana/id.json:ro
# Default command — override when running: docker compose run solana balance
command: ["--help"]Usage:
# Show help
docker compose run --rm solana --help
# Check balance
docker compose run --rm solana balance
# SPL token accounts
docker compose run --rm solana spl-token accountsThe Solana version is controlled via a build argument, making upgrades easy:
# Build with a specific version
docker build --build-arg SOLANA_VERSION=v2.1.21 -t mysolana:cli src/
# Or the latest stable (check https://github.com/anza-xyz/agave/releases)
docker build --build-arg SOLANA_VERSION=v3.1.8 -t mysolana:cli src/| Variable | Description | Default |
|---|---|---|
| (none yet) | Planned for future releases | — |
| Path | Description |
|---|---|
/root/.config/solana/id.json |
Wallet keypair file |
/root/.local/share/solana/install/active_release/bin |
Solana CLI binaries |
- Basic Solana CLI image
- SPL Token CLI
- Automated weekly CI rebuilds
- Versioned build ARG (
SOLANA_VERSION) - GitHub Actions layer cache (faster CI builds)
- QEMU + Buildx setup for future multi-arch support
- Docker Compose example
- Environment variable support (e.g.
SOLANA_NETWORK,SOLANA_URL) - Automatic version bump PRs via Dependabot / Renovate
- linux/arm64 support (requires Agave arm64 binaries or source build)
- Build tests (verify
solana --versionandspl-token --versionoutput)
