Project setup

vesta init Scaffold a new project interactively

Runs a wizard that asks which server type and features you want, then generates server.py, server.ini, requirements.txt and the appropriate directory structure.

cd myproject
vesta init

The wizard prompts for:

QuestionOptions
Server typehttp (BaseServer) or vesta (full-stack Server)
ORMInclude PostgreSQL query builder?
WebSocketsInclude real-time WebSocket support?
JS FrameworkCopy frontend JS modules to static/framework/?
MarkdownCopy the markdown parser?
CronCreate cron task stubs?

Answers are saved to vesta.manifest so other commands know what features are active.

vesta install Install Python dependencies for the current manifest

Reads vesta.manifest and installs the required packages via pip. Equivalent to pip install -r requirements.txt but generates requirements.txt first based on your selected features.

vesta install
vesta update Update vesta-web and reinstall dependencies
vesta update

Database

vesta db create Create the PostgreSQL database and user

Connects to the local Postgres instance as a superuser and creates the database user and database declared in server.ini [DB].

vesta db create
Note Requires a local PostgreSQL installation with a superuser accessible without password (peer auth). Typically run once at initial setup.
vesta db init Run the schema file against the database

Executes db/schema.sql against the database configured in server.ini. Run this after vesta db create or any time you update the schema.

vesta db init
vesta db reset Drop and recreate the database

Drops the database completely and runs vesta db create followed by vesta db init. Destroys all data.

vesta db reset
Warning This deletes all data. There is no confirmation prompt.

Nginx

Vesta ships nginx configuration templates for both local development and production (with SSL termination). The templates live in misc/ and reference your server.ini port settings.

vesta nginx setup Install the nginx virtual host configuration

Copies the appropriate config template to /etc/nginx/sites-available/, creates a symlink in sites-enabled/, and reloads nginx.

vesta nginx setup
vesta nginx mime Add .mjs MIME type to nginx

Adds application/javascript mjs; to /etc/nginx/mime.types so ES modules are served with the correct Content-Type header.

vesta nginx mime
Tip Run this once per server. Without it, browsers may refuse to execute .mjs files imported as modules.
vesta nginx reset Reinstall the nginx config from scratch

Removes the existing site config and re-runs vesta nginx setup. Useful after changing the port or domain in server.ini.

vesta nginx reset

systemd service

vesta service setup Install a systemd service for auto-start on boot

Creates /etc/systemd/system/<SERVICE_NAME>.service from the template in misc/vesta.service, reloads the systemd daemon, and enables the service.

vesta service setup

After setup, manage the service with standard systemd commands:

systemctl start  myapp
systemctl stop   myapp
systemctl status myapp
journalctl -u    myapp -f   # tail logs

The SERVICE_NAME value comes from server.ini [server].

Scheduled tasks (cron)

When the cron feature is selected at vesta init, your project gets a crons/ directory of task scripts. Each script subclasses Server and runs its exec() method. The vesta cron commands register those scripts with the user's crontab — the schedule for each is keyed by filename.

vesta cron setup Install the crons/ scripts into the crontab

Scans crons/ and writes an entry for each recognized script into a managed block in your crontab. Scripts run with the project virtualenv interpreter (venv/bin/python3), falling back to the system python3.

vesta cron setup

Schedules are assigned by filename:

ScriptScheduleCron expression
15mins.pyEvery 15 minutes*/15 * * * *
1h.pyHourly0 * * * *
1day.pyDaily at midnight0 0 * * *
exemple.pyDaily at midnight0 0 * * *
Note The command is idempotent: it manages its own marked block, so re-running updates entries instead of duplicating them, and any of your own crontab lines outside that block are left untouched. Scripts with no known schedule are skipped with a notice — add them to the CRON_SCHEDULES map in the installer to schedule them.
vesta cron reset Remove the vesta-managed cron entries

Strips the vesta-managed block from your crontab, leaving any other entries in place.

vesta cron reset

Testing

vesta test Run the test suite

Discovers and runs all tests in the tests/ directory. Requires a running PostgreSQL instance for ORM tests.

vesta test

Environment variables can override the test DB connection (used by CI):

VariableDefault
DB_HOSTlocalhost
DB_USERtest_user
DB_PASSWORDtest_password
DB_NAMEtest_vesta_db
DB_PORT5432

Project structure after vesta init

myproject/
├── server.py                  # Application entry point
├── server.ini                 # Configuration (never commit secrets!)
├── vesta.manifest             # Feature selections for CLI commands
├── requirements.txt           # Python dependencies
├── install.sh                 # One-shot server provisioning script
│
├── static/
│   ├── index.html             # Main HTML shell
│   ├── framework/             # Vesta JS modules (if selected)
│   │   ├── vesta.mjs
│   │   ├── navigation.mjs
│   │   ├── websockets.mjs
│   │   └── ...
│   ├── templates/             # HTML fragments for fillWith()
│   ├── translations/          # i18n .mjs files
│   ├── markdown/              # Markdown parser (if selected)
│   └── attachments/           # Uploaded files (auto-created)
│
├── db/
│   ├── schema.sql             # Table definitions — edit this
│   └── initDB.py              # Called by vesta db init
│
├── mailing/                   # Present when mailing is active
│   ├── dkim.txt               # DKIM private key
│   ├── mailVerif.html         # OTP verification email template
│   ├── mailReset.html         # Password reset email template
│   └── mailInvite.html        # Org invite email template
│
├── crons/                     # Present when cron is selected
│   ├── 15mins.py
│   ├── 1h.py
│   └── 1day.py
│
└── misc/
    ├── nginx_local            # nginx config for local dev
    ├── nginx_prod             # nginx config for production
    └── vesta.service          # systemd unit file template