Lantern Server Manager is a tool for managing your own Lantern servers. It will allow you to easily set up a server, configure it, and allow to share access to it with your friends.
- Zero config bootstrap - if no parameters are provided, we'll automatically generate random certificates/access keys.
- Runnable as a Docker container, single binary or a cloud Marketplace item.
- Supports configuration via environment variables, command line arguments or a config file.
- Creates easy access codes in its log by printing a QR code
- Web UI
- Console UI
- REST API
When running inside Docker container, we don't want to use random ports, so we need to specify the ports we want to use.
docker run -d \
--name lantern-server-manager \
-e NO_FIREWALLD=true \
-e NO_SYSTEMD=true
-p 8080:8080 \
-p 1234:1234 \
-v /path/to/config:/config \
getlantern/lantern-server-manager -d /config --vpn-port 1234 --api-port 8080
- Create a droplet using the Lantern Server Manager image from Marketplace
- Make sure to add your SSH key and open all ports to the instance
- When instance is up, use it's public IP address to fetch the initial token.
ssh root@xxxxxxxx sudo journalctl -u lantern-server-manager
- Start the instance using Lantern Server Manager image
- The image has its own firewall installed, so you need to open the ports you want to use.
gcloud compute firewall-rules create allow-all-to-instance \
--direction=INGRESS \
--priority=1000 \
--network=lanternet \
--action=ALLOW \
--rules=all \
--target-tags=allow-all-traffic \
--source-ranges=0.0.0.0/0
gcloud compute instances add-tags instance-20250414-160036 --tags=allow-all-traffic --zone=us-west1-c
- Now you can fetch the initial token
gcloud compute instances add-tags instance-20250414-160036 --tags=allow-all-traffic --zone=us-west1-c sudo journalctl -u lantern-server-manager
- Create an EC2 instance using the Lantern Server Manager image from Marketplace
- When creating the instance, select "vendor suggested security group".
- This will create a security group that allows all traffic to the instance.
- When instance is up, use it's public IP address to fetch the initial token.
ssh ec2-user@xxxxxxxx sudo journalctl -u lantern-server-manager
- Start the server. On startup, it will generate a random access key and print it in the logs. It will also let you know you public IP address and the API port.
export API_KEY=your_access_key
- Request your own VPN configuration
curl -vk https://xxx.xxx.xxx.xxx:yyyy/api/v1/connect-config?token=$API_KEY
- This config can be used with SingBox or with LanternVPN
- To share access with other users, you can create a share link by calling the
createShareLink
API. This will generate a link that you can send to the user you want to share access with. Each link has a unique name associated with that user. curl -vk https://xxx.xxx.xxx.xxx:yyyy/api/v1/share-link/unique-user-name?token=$API_KEY
- This will generate a link in the format
lantern://xxx.xxx.xxx.xxx/yyyyyy
wherexxx.xxx.xxx.xxx
is the server's IP address andyyyyyy
is the access key. The access key is timestamped and expires after NN minutes. - You can send this link to the user you want to share access with. When they click the link, it will open the Lantern app and prompt them to connect to the server.
- The user's Lantern VPN app will issue the same
/connect-config
request but will use the access key from the link instead of the root access key.
- User starts the server
- User gets a QR code in the logs
- The QR code contains the URL to the server and the access key
- User scans the QR code with the Lantern app
- The app is now the MANAGER of the server
- The app can now share access to the server with other users by calling a 'create share link' API and sending the resulting link to the user they want to grant access to
- The link is in lantern://xxx.xxx.xxx.xxx/yyyyyy format, where
- xxx.xxx.xxx.xxx is the server's IP address
- yyyyyy is the access key (the key is timestamped and expires after NN minutes)
- The user clicks the link and is redirected to the Lantern app
- Their app will create a private/public key pair and send the public key to the server together with the access key
- The server will verify the access key and store the public key in its VPN 'peer' list
- The new user can now connect to the VPN
- The "root" access key is the one that is generated when the server is started.
- It's the only key that can be used to manage the server.
- It's stored in the server's config file and on the phone that scanned the initial QR
- If that key is lost, the server can no longer be managed and the only way to regain access is to delete the config file and start over.