Before you start
- A Linux server (amd64 or arm64) with systemd and root access. The installer adds Docker if it is missing.
- A Next.js app in a git repository the server can reach.
- A terminal on the server, or on your own machine with the CLI installed.
Prepare the app
Set output: "standalone" in next.config for the smallest runtime image. Levelrail's Next.js preset fills in the port and health path, and keeps .next/cache on a volume so optimised images and ISR pages survive a redeploy.
import type { NextConfig } from "next";
const config: NextConfig = {
output: "standalone",
};
export default config;Install and deploy
Step 1Install the control plane
Run the installer on the server. Its last lines print the dashboard address and a one time setup link.
bash curl -fsSL https://levelrail.com/install.sh | sudo shStep 2Create the admin account
Open the setup link and choose a password. The first sign in offers a free certificate on an automatic hostname with one click, so you can have HTTPS before you touch DNS.
Step 3Sign the CLI in
On the dashboard home, the Connect your CLI card shows a ready made command with a single use pairing code. Paste it into your terminal. The installer already put
levelrail-clion the server's path.bash levelrail-cli login --api-url http://<server-ip>:8080 --code ABCD-EF23Step 4Preview the plan
Import the repository without deploying first. Without
--deploy, the CLI only prints the deployment plan and changes nothing, so you can read it before anything is created.bash levelrail-cli import https://github.com/your-org/your-appStep 5Create and deploy the app
Run the same command with
--deployto create the app and start its first build.bash levelrail-cli import https://github.com/your-org/your-app --deployStep 6Find the address
openprints the app's public addresses, custom domain first and then the automatic URL.bash levelrail-cli open your-app
Logs and rollback
Step 7Read the logs
Read an app's recent logs from the terminal. The dashboard has the same logs with search.
bash levelrail-cli logs your-appStep 8Roll back a bad deploy
Deploys are gated on readiness and every release keeps its image, so going back to the previous successful deploy is one command.
bash levelrail-cli rollback your-app
To deploy on every push, connect the repository through your git host's webhook from the app's source settings. The Levelrail docs cover webhooks, preview environments and custom domains.
If something fails
- The installer says the control plane did not become healthy: check
systemctl status levelrailandjournalctl -u levelrail -n 100 --no-pager. A port already in use is a common cause. - The installer reports a checksum mismatch: stop and run it again. Never skip the checksum check to get past it.
- The CLI says connection refused when signing in: it points at the wrong address. Check the
--api-urlvalue against the dashboard address. - An import says connection refused: the control plane is not running. Start it with
systemctl start levelrail.