Redeploy and roll back
Apply new code and settings to an app, or return to an earlier commit.
A redeploy fetches the source of one app, builds it and rolls out the new deployment. Use it to apply new code, changed variables and changed ports. To roll back, redeploy an earlier commit. Deployments explains what a deployment is.
Before you start
- A deployed app. The examples use
copperfox. - New code is pushed to GitHub. LILY builds from GitHub.
Choose the right command
| You want to | Use | Rebuilds |
|---|---|---|
| Apply new code or changed variables to one app | redeploy | One app |
| Deploy all apps of the repository again | deploy | All apps of the source |
| Start the same build again without changes | restart | Nothing |
Steps
Redeploy the latest commit
Open the app and select Redeploy in the action bar, next to Start, Stop and Restart.
lly redeploy copperfoxlly follows the build and prints the same summary as lly deploy.
Roll back to an earlier commit
Redeploy a tag or commit that worked.
Redeploy in the console always builds the latest commit of the branch. To build an earlier commit or tag, use the CLI.
lly redeploy copperfox --ref v1.4.2
lly redeploy copperfox --ref a1b2c3dThe next redeploy without --ref builds the latest commit of the branch again.
Check that it worked
lly app copperfox deploymentsDeployment State Cap Placed
dep_9 live cap_3 2026-10-06 14:02
dep_8 superseded cap_3 2026-10-05 09:40The new deployment is live and the previous one is superseded. Cap is the machine the deployment runs on.
If it does not work
| What you see | Cause | Fix |
|---|---|---|
Exit code 5 | Another command or build is running on the app | Wait until it finishes. See The project is busy. |
Exit code 7 | The build or rollout failed | lly attach --build copperfox shows the build log. See The build failed. |
| The build is reported as unchanged | Nothing changed since the last deploy | Push your commit first |
| The app cannot be redeployed | It comes from a private repository added by URL with a token, and the token is not stored | Connect GitHub and deploy the repository through the connection |
More messages and their fixes: Troubleshooting.
Use an agent
Roll my LILY app "copperfox" back to the tag v1.4.2.
Run `lly redeploy copperfox --ref v1.4.2`, wait for the build,
then show me the output of `lly app copperfox deployments`.