VPS project templates: static site, Node.js, PHP and WordPress with Docker, ready to deploy

API & DocumentationInfrastructure & DevOps·· 125 views· 3 min read

Four small example projects, ready to publish on a MozOut VPS with Docker Compose. Each one has HTTPS out of the box: Caddy gets and renews the certificate for your domain on its own.

What it does

static-site: HTML and CSS files, served by Caddy. node-app: a Node.js app with no dependencies, behind Caddy. php-app: a PHP site with a contact form, on PHP-FPM behind Caddy. wordpress: WordPress with MariaDB, behind Caddy, with a backup script.

deploy.sh copies the template you choose to the server and starts it.

What you need

A MozOut VPS with Ubuntu or Debian, Docker and the Docker Compose plugin, and ports 80 and 443 open. SSH access to the server, ideally with a key. A domain whose DNS points to the server. And ssh and rsync on your computer.

Steps 2 and 3 use the API, so you need a key created in the API Center of My MozOut.

Installing, step by step

1 Download the source of the latest release and unzip it on your computer.
2 Find the IP of your server in My MozOut or through the API (first block below). The ip field is the address.
3 Point the domain to that IP, with A records for @ and www. If the domain uses MozOut DNS, you can add them through the API, as the README shows. If a record with that name already exists, change it instead.
4 Copy the template to the server with deploy.sh (second block below). The first time, it creates .env on the server from .env.example and stops. Edit it on the server, at least DOMAIN.
5 Run the same command again to start the site. The first visit can take a few seconds while Caddy gets the certificate.

export MOZOUT_API_KEY="prod_..."
curl -sS "https://api.mozout.com/v1/servers" -H "Authorization: Bearer $MOZOUT_API_KEY"

sh deploy.sh static-site root@203.0.113.10

Replace 203.0.113.10 with the IP of your server and static-site with the template you want. To edit .env, for example: ssh root@203.0.113.10 nano /srv/static-site/.env.

To update, change the files and run deploy.sh again. .env stays on the server and is never copied or deleted.

The API key and its permissions

To find the IP, the key needs vps:read. To add the DNS records, it needs dns:write. See how to create a key and pick its permissions.

Testing without spending

A sandbox_ key simulates writes and charges nothing. It is fine for trying the API calls, but the DNS records only really change with a prod_ key.

Good to know

With an AI agent: with the Claude Code plugin, ask "deploy this project to my VPS". The deploy-to-vps and connect-domain skills follow these same steps and ask before each change.

Publishing on every push: to copy the site from a workflow, see the deploy-on-vps GitHub Action.

Help

If a template does not start on your VPS, open a support ticket and tell us which template you used and the message you see. The code is in the templates repository, under the MIT license.

Ready to put your project online?

Download the latest release

SEE ALSO

Docker Compose: an application with its database

DNS through the API

Creating an SSH key

The repository on MozOut Git

SDKs and integrations, in the API documentation

RECOMMENDED PRODUCT

VPS server with root access

Resources of your own, the OS you choose, reinstall whenever you like. from R151.20/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.