Choose how to deploy
Just want your project online? Start with your coding agent. Give it the BoxLite agent guide and your GitHub repository URL. You can copy this prompt:Before you begin
You need a macOS or Linux computer, a Bash or Zsh terminal, curl, and an internet connection. This walkthrough was tested on macOS; Windows and WSL were not tested. A box is your isolated Linux environment in the cloud. The CLI on your computer creates the box, runs commands inside it, and retrieves its public URL. In the BoxLite console:- Sign up or sign in and select an organization. Keep the same organization selected throughout: it owns your boxes, API keys, and billing.
- Open Management → Billing or Wallet. Confirm you have available usage balance, capacity for 1 CPU, 1 GiB of memory, and 4 GB of requested disk, and one free running-box slot. If needed, add balance or choose a plan using the account page. This tutorial does not require automatic top-ups. See Plans and limits.
- Open API Keys → New API key. Name it
flaskr-workshop, choose Manage box lifecycle under Access, select an expiration that covers this tutorial, and click Create API key. The default Operate boxes access does not include the deletion permission needed for cleanup. - Copy and save the full key while it is displayed. The masked value in the key list cannot be used to sign in.
Run every command below in your local terminal. Commands beginning with
boxlite exec run the program that follows inside the cloud box. Keep your API key private; app visitors only need the HTTPS link.1. Install the CLI and connect
Install the official CLI:workshop is the name of the connection saved on your computer. Every command explicitly uses this context to target the same environment.
The API endpoint is https://api.boxlite.ai, not the console URL. Verify your connection:
2. Create a box
Create a box namedflaskr-workshop using an image with Python installed. First check that your list contains no box with this name. If it does, choose a different name and replace it throughout the commands below.
flaskr-workshop under Boxes in the console.
The box requests 1 CPU, 1024 MiB of memory, and 4 GB of disk. --inbound enabled allows access to the web service you will register later. --auto-stop 6h sets the idle-stop threshold; --auto-delete 0 keeps the box until you delete it.
The startup command waits for /workspace/start.py, then runs it. You will create that file in step 4. The same saved command runs whenever the box starts again. See Box lifecycle for the lifecycle settings.
3. Download, install, and test the app
Download the source from a fixed GitHub commit. Python inside the box downloads and extracts the archive; you do not need a GitHub token or local checkout.GitHub source ready: appears, install the dependencies:
-w option sets the working directory inside the box. Flask is the application framework, pytest runs the tests, and Waitress serves the web app.
Once installation succeeds, run the example’s tests:
24 passed. If downloading, installing, or testing fails, resolve that error and retry the relevant step; you do not need a new box. These tests use a separate test database, so you can run them again later without clearing your blog posts.
4. Initialize the database and start the app
Database initialized appears, write the startup file:
Startup file ready, the command saved in step 2 starts the app automatically. The file loads Flaskr and serves it through Waitress on 0.0.0.0:3000. You do not need to keep your local terminal open.
5. Open and share your app
Create an HTTPS access URL for port 3000:https://…proxy.boxlite.ai URL returned by your command and open it in your browser. If a preview notice appears, follow its instructions. If the app is still starting, wait briefly and refresh.
You should see the Flaskr homepage. Try the complete flow:
- Click Register and create an account with a fictional username and a password used only for this demo.
- Log In, click New, enter a title and body, and click Save.
- Refresh the page and confirm your post is still there. Click Edit, change the body, and save again.
- Log Out and confirm you can still read the post.
Come back to the same URL
You do not need to redeploy or open a terminal before each visit. This tutorial keeps the default Wake on access behavior. When the box stops after being idle, its code and database stay on disk. Visiting the registered HTTPS URL wakes the box, and the saved startup command starts Flaskr again. The first request may take longer.6h is an idle-stop threshold, not the URL’s lifetime or a spending cap. Automatic wake requires the box to exist, Wake on access to remain enabled, a registered port, a valid startup command, and available account balance and capacity. See Box lifecycle.
If you lose the URL, run the same network tunnel command again. Do not initialize the database again to recover access.
6. Clean up when you are done
To keep using the app, retain the box and monitor usage in Billing. Stopped disk storage can still incur charges. Closing your terminal or revoking your API key does not delete the box.flaskr-workshop no longer appears in the list. Its old URL can no longer serve the app. If the list request fails, retry or verify deletion in the console. Delete only the box created for this tutorial.
If the API key was only for this tutorial, open API Keys in the console, find flaskr-workshop, and choose Revoke key. Confirm revocation, then clear the local credentials:
Troubleshooting
Only if access fails, inspect the box and try starting it manually:
Deploy your own project next
You have completed the full path: create an environment, download code, install dependencies, test, start, and share. For your own project, replace the image, source URL, working directory, dependency and test commands, startup file, and service port. This example pins the source commit and direct dependencies, but does not fully lock the base image or transitive dependencies. It is an introductory deployment, not a production security, backup, or load-testing checklist.Serve HTTP
Configure the startup command and port for your own web service.
Box lifecycle
Choose when your app stops, wakes, and is deleted.

