WORKLOAD DOCUMENTATION

Python VPS Setup and Management

Deploy Python applications on Ubuntu KVM with isolated dependencies, a background service and a recovery plan.

Overview, platform and installed software

This guide covers a provisioned Ubuntu 24.04 LTS KVM Workload. Check the version installed on your server.

The delivered environment includes Python 3.12 and venv support. Use pip inside an activated environment. FastAPI and Flask are optional dependencies you install for your project.

Choose resources, order and sign in

Public configuration baseline: 1 vCPU, 1 GB RAM and 25 GB storage. Allow headroom for your application and data.

Select the Workload and region in the Builder and confirm availability and the quote. After provisioning, connect via SSH using the access details for your service.

Initial configuration and practical examples

Give each project its own environment and dependency file. Install dependencies with python -m pip inside that environment. For FastAPI or Flask, use a production application server appropriate to the framework.

Application management, settings and security

Run persistent apps as an unprivileged user through a service definition that invokes the virtual environment executable. Keep environment variables in a restricted file and serve public web apps through an HTTPS reverse proxy.

Updates, backups and recovery

Back up source, dependency files, service definitions and application data. Recreate the environment from dependencies when restoring. Test dependency updates separately and check the interpreter path and service logs if startup fails.

Troubleshooting, limitations and FAQ

If pip works in your SSH session but imports fail in the service, check the service executable, working directory and permissions.

Getting Started

  1. Check Python and create an isolated environment

    Connect to your VPS over SSH. Create a separate Python 3.12 virtual environment for each project to keep its dependencies isolated.

    python3 --version
    python3 -m venv myenv
    source myenv/bin/activate
  2. Install a package inside the environment

    Global pip is not preinstalled. Use the pip provided inside the activated virtual environment to manage project packages.

    python -m pip --version
    python -m pip install requests