A complete Docker-based development template for building fullstack Solana applications with Anchor, featuring automatic setup, deployment, and a modern web stack.
This template includes 4 Docker services:
- solana-validator - Local Solana test validator (v1.18.26)
- anchor-program - Anchor development environment (v0.31.0) with auto-deployment
- backend - Node.js/Express backend server
- frontend - Frontend application (React/Vue/Svelte)
- 🔄 Fully Automated Setup - Wallet creation, funding, and configuration
- 🚀 One-Command Deployment - Custom
anchor-deployscript with Docker compatibility - 🔧 Hot Reload - Changes reflect instantly across all services
- 🐳 Isolated Environment - No local Solana/Anchor installation needed
- 📦 Production Ready - Optimized Docker configuration with caching
- Docker Desktop installed
- At least 8GB RAM available for Docker
- Ports available:
3000,5174,8899,8900,9900
git clone https://github.com/cybercivizen/anchor-fullstack-template.git
cd anchor-fullstack-template
docker-compose up -dThis automatically:
- ✅ Starts Solana test validator
- ✅ Creates wallet keypair
- ✅ Airdrops SOL for testing
- ✅ Configures Solana CLI
- ✅ Starts backend and frontend
docker-compose exec anchor-program bash
cd /workspace
anchor init my-app
cd my-appUpdate my-app/Anchor.toml:
[provider]
cluster = "http://solana-validator:8899"
wallet = "/workspace/.anchor/test-keypair.json"anchor build
anchor-deploy
# or simply: deployThat's it! Your program is deployed and ready to use. 🎉
- Frontend: http://localhost:5174
- Backend: http://localhost:3000
- Solana RPC: http://localhost:8899
- Solana WebSocket: ws://localhost:8900
- Faucet: http://localhost:9900
The test validator is configured in docker-compose.yml:
solana-validator:
image: solanalabs/solana:v1.18.26
ports:
- "8899:8899" # RPC
- "8900:8900" # WebSocket
- "9900:9900" # Faucet
- "8001:8001" # Gossip
- "8003:8003" # TPUenvironment:
- ANCHOR_PROVIDER_URL=http://solana-validator:8899
- ANCHOR_WALLET=/workspace/.anchor/test-keypair.jsondocker-compose exec anchor-program solana airdrop 5docker-compose down
docker-compose up -d --builddocker-compose down -v
docker-compose up -d --buildBuilt with ❤️ for the Solana ecosystem