Run your own app in the browser
Any web app you start on your GPU machine on port 7860 opens with Open my app on your running instance: Streamlit, Gradio, FastAPI, a dev server. Only you can open it, the same way as JupyterLab and the other built-in apps, and access ends when the machine stops.
1. Start your app on 127.0.0.1, port 7860
Use a terminal on the machine (SSH, or a JupyterLab terminal). Listen on 127.0.0.1 only: the machine has no public web port, and the browser reaches your app through ComputeNexa's protected connection, never directly.
Streamlit
streamlit run app.py --server.port 7860 --server.address 127.0.0.1 --server.headless trueGradio
demo.launch(server_name="127.0.0.1", server_port=7860)FastAPI (uvicorn)
uvicorn main:app --host 127.0.0.1 --port 7860Next.js dev server
npx next dev -H 127.0.0.1 -p 7860Next.js blocks dev requests from other addresses: add your app's domain to next.config, e.g. allowedDevOrigins: ["*.computenexa-apps.com"].
To keep it running after you close the terminal, start it inside tmux or with nohup … &.
2. Open it
On Instances, click Open my app. If nothing is listening on port 7860 yet, you'll see a page saying so; it checks again every 10 seconds, so it shows your app as soon as it starts.
Good to know
- Websockets and streaming work (Streamlit, Gradio). No need to turn off Streamlit's CORS or XSRF protection: the browser talks to your app at its own address.
- Your app is served at the root of its address (
/); no base path is needed. - One app per machine on port 7860. Other ports aren't reachable from the browser.
- Files your app writes are kept only if they're in
~/workon a machine with a project.
More guides
- Getting started: rent your first GPU: Sign up, pick a GPU and an app, launch it, connect, and stop it when you're done.
- Set up your organization and invite your team: One shared balance for your company: roles, invitations, GPU limits and who can see what.
- Use the ComputeNexa API: Launch, check and stop GPUs from your own scripts, CI jobs or platform with an API key.
- Python SDK: pip install computenexa: launch, use and stop GPUs from Python, with waiting and clear errors built in.
- Command-line tool (cnx): cnx launch, ls, ssh, stop: your GPUs from the terminal, scripts and CI.
- API reference: Every API operation by name (listProjects, launchInstance…), with its request and reply.
- What's in each image: Exactly what's installed in each app's images: Ubuntu, CUDA, Python, packages and versions.
Questions? Email support@computenexa.com.