Getting started
This guide takes you from nothing installed to a running project in about five minutes.
Before you begin
You will need:
- A terminal and an internet connection
- Node.js 18 or later (run
node --versionto check) - A Lumen account. Sign up at /signup if you do not have one yet.
Install the command line tool
The CLI is distributed through npm. Install it globally:
npm install -g lumen-cli
Confirm the installation worked:
lumen --version
Steps
-
Log in
Authenticate the CLI with your account. This opens a browser window to approve the request.
lumen login -
Create a project
Run this from the root of your application directory. It creates a
lumen.jsonfile that links the folder to a project in your account.lumen init my-first-project -
Deploy
Push your code. You will get back a preview URL once the build finishes.
lumen deploy -
Promote to production
When the preview looks right, promote it to your production domain.
lumen promote --latest
Configuration file
After lumen init, your project contains a lumen.json similar to this:
{
"name": "my-first-project",
"build": "npm run build",
"output": "dist",
"regions": ["iad1"]
}
lumen.json to version control. Secrets belong in environment variables, not in this file. See Environment variables.
Troubleshooting
"command not found: lumen"
Your global npm bin directory is probably not on your PATH. Run npm config get prefix and add the bin folder inside that path to your shell profile.
Build fails during deploy
Run npm run build locally first. The deploy uses the same command, so any error you see there will also stop the deploy.
Still stuck?
Check the support page or run lumen doctor to print diagnostic information you can paste into a ticket.