Lantern - Docker Installation
Install Lantern using Docker for the fastest and easiest setup, including the local web configuration tool.
Docker Installation
You will need to have Docker installed. Just run:
Shell
docker pull ghcr.io/alphabatem/lantern-release:latest
Shell
docker run -d --name lantern -p 8080:8080 -p 8090:8090 ghcr.io/alphabatem/lantern-release:latest
Web Configuration Tool
On startup, if there is no configuration file created, Lantern will launch a web configuration tool. Point a web browser to the URL provided. It will guide you through creating your first configuration file.
Once you are happy with the config file, select "Save and Run".
See the Web Configuration Tool section for more information.
Editing Docker-Compose
If you want to change the port Lantern serves requests on, you need to edit both the Docker Compose file and set it in the config. Here is a sample Docker Compose file for Lantern:
docker-compose.yml YAML
services:
lantern:
image: ghcr.io/alphabatem/lantern-release:latest
restart: unless-stopped
pull_policy: always
ports:
- "8080:8080"
- "8080:8090"
volumes:
- lantern-data:/app/data
networks:
- lantern-network
networks:
lantern-network:
driver: bridge
volumes:
lantern-data:
driver: local
Note
If you wish to change the default directory for Lantern's config file, you'll need to add something like this to the Docker Compose file:
YOUR_MOUNTED_PLACE:/app/config.json # <-- add this line to docker compose volume config
Using Lantern
Once Lantern finishes startup, you can start making requests. Requests made before startup finishes will just be forwarded to FluxRPC — Lantern will never risk responding with out-of-date information.
Generally, interesting requests to make are:
getAccountInfogetMultipleAccountsgetBalancegetProgramAccounts
If you make these requests to Lantern for accounts owned by a program you've defined in the config file, it will respond from cache instead of sending the request to the RPC. In this case, Lantern will respond very quickly . The exact speed depends on your computer, but during testing, 100-200 microseconds was pretty typical.
Note
Lantern will need to be able to receive inbound traffic on port 8080, 8081 and 8090, and send outbound traffic to the Internet on ports 443, 8080 and 8081.
Open the section overview for the broader context, live navigation, and interactive code examples.
Continue in this section
- Lantern - Command-Line Installation — Install Lantern as a command-line application for more control with a direct binary setup workflow.
- Lantern - Example Configuration Files — Pre-built Lantern configuration files for common use cases such as benchmarks, DEX indexing, and memecoin tracking.
- Lantern - Configuration (Local) — Configure Lantern for local deployment with the web configuration tool or a manual JSON configuration file.
- Lantern - Web Configuration Tool — Use the Lantern web configuration tool to configure, test, and benchmark your Lantern instance from the browser.
- Lantern - Configuration (Remote) — Configure Lantern for remote server deployment with Docker or direct binary installation on managed infrastructure.
- Lantern - WebSocket Support — Lantern supports Solana WebSocket methods for real-time account and program subscriptions on a local caching stack.