Skip to main content

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:
You still need a Cloud account, available balance and capacity, and an API key. Follow the agent’s requests for access and project-specific configuration. The guide provides deployment instructions; the agent performs the steps for your project. Want to run each command yourself? Continue with this manual tutorial. You will deploy Flask’s official Flaskr example: a small blog with registration, sign-in, and editable posts. By the end, you will have a public HTTPS URL that remains usable after you close your local terminal. You do not need to write application code or install Python, Docker, or Git on your computer. The app’s dependencies and SQLite database live inside the Cloud box.

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:
  1. Sign up or sign in and select an organization. Keep the same organization selected throughout: it owns your boxes, API keys, and billing.
  2. 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.
  3. 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.
  4. 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:
Once the version command succeeds, sign in to Cloud:
Paste your full API key when prompted and press Enter. Input may be hidden. 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:
The identity check should succeed and the box list should return normally. An empty list also means the connection works. Resolve authentication errors before creating a box.

2. Create a box

Create a box named flaskr-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.
The create command prints a box ID. After startup succeeds, you can find 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.
After GitHub source ready: appears, install the dependencies:
The -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:
Expected output:
Continue after you see 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

Run the database initialization command only once. Running it again deletes existing application accounts and posts and replaces the session secret. Do not repeat it to restart the service or rerun tests.
After Database initialized appears, write the startup file:
Once you see 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:
Copy the full 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:
  1. Click Register and create an account with a fictional username and a password used only for this demo.
  2. Log In, click New, enter a title and body, and click Save.
  3. Refresh the page and confirm your post is still there. Click Edit, change the body, and save again.
  4. Log Out and confirm you can still read the post.
Your GitHub app is now running on BoxLite Cloud. Share its HTTPS URL: visitors do not need a BoxLite account or API key. To publish posts, they register an account in Flaskr itself.
This example is publicly accessible. Use demo data only. See Tunnels for details about the access URL.

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.
The following command deletes the box, including its code and database. Save any posts you want to keep first.
Confirm that 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:
Confirm when prompted. If you stop partway through the tutorial, clean up any box you created. See Usage and costs.

Troubleshooting

Only if access fails, inspect the box and try starting it manually:
These commands are for diagnosis, not a prerequisite for each visit. If manual startup works but automatic wake does not, check Wake on access, the registered port, and account status. Never use database initialization to repair access. When asking for help, include the failing step, CLI version, box ID, and error text. Do not include your full API key.

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.