Skip to main content

No project description provided

Project description

deployvm

Python CLI for deploying web applications to cloud providers (DigitalOcean and AWS).

When setting up a VM it will:

  • Create a cloud instance (DigitalOcean droplet or AWS EC2)
  • Configure firewall rules to open ports 80, 443, and SSH
  • Create a deploy user with passwordless sudo
  • Set up a swap file
  • Upload your SSH key to the provider
  • Install uv, nginx, supervisord (FastAPI) or pm2 (Nuxt)
  • Deploy your app and configure it to run as a service
  • Set up nginx as a reverse proxy
  • Optionally provision a Let's Encrypt SSL certificate via certbot

Installation

uv tool install deployvm

Quick Start

1. Configure Provider

Create .env in your project root:

# DigitalOcean (default)
DEPLOY_VM_PROVIDER=digitalocean

# AWS
DEPLOY_VM_PROVIDER=aws
AWS_PROFILE=default
AWS_REGION=ap-southeast-2

Auth setup:

  • AWS: aws configure
  • DigitalOcean: doctl auth init

2. Deploy Your App

Without SSL:

uv run deployvm fastapi deploy my-server /path/to/app \
    "uv run uvicorn app:app --port 8000" \
    --port 8000 --no-ssl

With domain + SSL:

# 1. Get nameservers
uv run deployvm dns nameservers example.com --provider aws

# 2. Configure at registrar, wait 24-48h for propagation

# 3. Deploy with SSL
uv run deployvm fastapi deploy my-server \
    /path/to/app \
    "uv run uvicorn app:app --port 8000" \
    --port 8000 \
    --domain example.com \
    --email you@example.com

Supported app types:

  • fastapi deploy - FastAPI apps with uvicorn + supervisord
  • nuxt deploy - Nuxt apps with PM2

3. Manage Your Deployment

uv run deployvm instance verify my-server --domain example.com
uv run deployvm fastapi logs my-server
uv run deployvm fastapi restart my-server
uv run deployvm fastapi sync my-server /path/to/app "uv run uvicorn app:app --port 8000" --port 8000

Common Workflows

Add SSL After Deployment

# 1. Deploy without SSL
uv run deployvm fastapi deploy my-server /path/to/app "uv run uvicorn app:app --port 8000" --port 8000 --no-ssl

# 2. Get nameservers and configure at registrar, wait 24-48h

# 3. Add SSL
uv run deployvm nginx ssl my-server example.com you@example.com --port 8000

Multiple Apps on One Instance

uv run deployvm fastapi deploy my-server /path/to/api \
    "uv run uvicorn app:app --port 8000" \
    --port 8000 --app-name api --domain api.example.com --email you@example.com

uv run deployvm nuxt deploy my-server /path/to/frontend \
    --app-name frontend --port 3000 --domain example.com --email you@example.com

uv run deployvm instance apps my-server

Configuration

Environment Variables

Variable Description Default
DEPLOY_VM_PROVIDER Cloud provider (aws or digitalocean) digitalocean
AWS_PROFILE AWS CLI profile name None
AWS_REGION Default AWS region ap-southeast-2

Application Credentials

Your app's .env inside the app directory is automatically uploaded during deploy or sync.

When deploying to AWS EC2, AWS_PROFILE, AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY are stripped (EC2 uses IAM roles), and AWS_REGION is preserved/added.

Provider Settings

Setting AWS DigitalOcean
Regions us-east-1, us-west-2, ap-southeast-2 syd1, sgp1, nyc1, sfo3, lon1
VM Sizes t3.micro, t3.small, t3.medium s-1vcpu-1gb, s-2vcpu-2gb, s-4vcpu-8gb
DNS Route53 (auto-created) DigitalOcean nameservers required
Auth aws configure doctl auth init

AWS Bedrock Access

EC2 instances automatically get Bedrock access via IAM roles:

uv run deployvm fastapi deploy my-server /path/to/app "uv run uvicorn app:app --port 8000" --port 8000 --no-ssl
# or with custom role:
uv run deployvm fastapi deploy my-server /path/to/app "uv run uvicorn app:app --port 8000" --port 8000 --iam-role my-role --no-ssl

Your app code needs no credentials:

import boto3
bedrock = boto3.client('bedrock-runtime', region_name=os.getenv('AWS_REGION'))

Commands Reference

deployvm instance create|delete|list|verify|apps
deployvm dns nameservers
deployvm nginx ip|ssl
deployvm fastapi deploy|sync|restart|status|logs
deployvm nuxt deploy|sync|restart|status|logs

Common options:

  • --provider aws|digitalocean
  • --region <region>
  • --vm-size <size>
  • --domain <domain>
  • --no-ssl
  • --app-name <name>
  • --iam-role <name> (AWS only)

Requirements

Tool Purpose Required Install
uv Python package manager Yes curl -LsSf https://astral.sh/uv/install.sh | sh
ssh, rsync, tar, scp File transfer & remote ops Yes Pre-installed (macOS/Linux)
doctl DigitalOcean CLI Optional brew install doctl
aws AWS CLI Optional brew install awscli
npm Nuxt local builds Optional brew install node

SSH Key

Automatically uploads ~/.ssh/id_ed25519.pub, id_rsa.pub, or id_ecdsa.pub to the provider on first use.

Instance State

Metadata stored in <name>.instance.json:

{
  "id": "i-0abc123",
  "ip": "54.123.45.67",
  "provider": "aws",
  "region": "ap-southeast-2",
  "vm_size": "t3.small",
  "user": "deploy",
  "apps": [
    {"name": "api", "type": "fastapi", "port": 8000},
    {"name": "frontend", "type": "nuxt", "port": 3000}
  ]
}

Support

  • Issues: GitHub Issues
  • Help: deployvm --help or deployvm <command> --help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deployvm-0.1.6.tar.gz (249.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deployvm-0.1.6-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file deployvm-0.1.6.tar.gz.

File metadata

  • Download URL: deployvm-0.1.6.tar.gz
  • Upload date:
  • Size: 249.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.5

File hashes

Hashes for deployvm-0.1.6.tar.gz
Algorithm Hash digest
SHA256 0224d9b166758afc683acda244d67132410e42341da2a45a2746077874dd18db
MD5 a6c6d5c20aae2964a7606d94258baf17
BLAKE2b-256 3fdf054933bb5562dac464a8961348067e589318c70a5098e25f36db059ff646

See more details on using hashes here.

File details

Details for the file deployvm-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: deployvm-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.5

File hashes

Hashes for deployvm-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7169cbe88eb6c655ef64dfea8e8c6f6d7c87666dc30a594f9fb0a4688fb16056
MD5 7d145d4e7fa47a4bf4960bd13bd71c2a
BLAKE2b-256 fa58de21e9f4f5b751b52f253afd1ddc6ab8e596004e0954ba3fa49985d612dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page