Skip to main content

Deploy a Marimo Notebook to the Cloud

Marimo is a reactive Python notebook that stores notebooks as plain .py files. This tutorial deploys a marimo notebook editor on a cloud VM using anycloud serve, giving you an HTTPS-accessible notebook in one command.

What you'll need

🚀 Deploy

The official marimo Docker image works out of the box — just set PORT=8088 so anycloud can route traffic to it:

import anycloud

ac = anycloud.Client()

job = ac.serve(
"ghcr.io/marimo-team/marimo:latest-sql",
env={"PORT": "8088"},
)
print(job.url)

Once deployed, open https://<id>.anycloud.sh in your browser. You'll see the marimo editor with full Python execution.

The latest-sql tag includes DuckDB and database connectors. Use latest for a minimal image.

📊 Monitor

# Check deployment status
anycloud list

# Stream container logs
anycloud logs <deployment-id> --follow

# SSH into the VM
anycloud ssh <deployment-id>

📦 Custom dependencies

For notebooks that need additional packages, extend the official image:

FROM ghcr.io/marimo-team/marimo:latest-sql
RUN pip install numpy pandas scikit-learn matplotlib

Build and deploy:

anycloud build
anycloud serve ghcr.io/<your-github-user>/marimo:latest \
--credentials my-aws \
-e PORT=8088

⚡ GPU notebooks

For ML notebooks with GPU access, build a custom image with CUDA support:

FROM nvidia/cuda:12.4.0-runtime-ubuntu22.04

RUN apt-get update && apt-get install -y python3 python3-pip && \
pip3 install marimo torch torchvision

ENV PORT=8088 HOST=0.0.0.0
CMD ["sh", "-c", "marimo edit --no-token -p $PORT --host $HOST"]

Deploy with GPU flags:

anycloud build
anycloud serve ghcr.io/<your-github-user>/marimo:latest \
--credentials my-aws \
--gpu-type a100 \
--gpus all \
--runtime nvidia \
-e PORT=8088

🧹 Cleanup

anycloud terminate <deployment-id>

Next steps