# How to publish a static folder on a VPS with Caddy

> Serve a static folder on a VPS with Caddy and HTTPS, then compare when Revdoku is simpler for publishing AI-generated file bundles.

A VPS gives you full control over hosting. This tutorial shows the simple version: create a server, install Caddy, copy a static folder to the server, point a domain at it, and let Caddy serve it with HTTPS.

This is a useful workflow when you want to own the infrastructure. It is also a good contrast with Revdoku, where the same kind of folder can be published without operating a server.

## What you need

Start with a static folder:

```text
static-site/
index.html
styles.css
app.js
Readme.md
data/report.csv
docs/brief.pdf
assets/chart.webp
```

You also need:

- A VPS from AWS Lightsail, Hetzner, DigitalOcean, or another provider.
- SSH access.
- A domain or subdomain if you want HTTPS on a real hostname.
- Basic comfort with the command line.

![Creating a Linux instance in AWS Lightsail](/assets/blog/publish-static-folder-vps-caddy/01-vps-create-server.png)

![Choosing an AWS Lightsail instance plan](/assets/blog/publish-static-folder-vps-caddy/02-vps-plan-selection.png)

![Choosing a local static folder before publishing](/assets/blog/publish-static-folder-vps-caddy/choose-local-folder.webp)

## 1. Create a VPS

Create a small Linux server with your provider.

Ubuntu LTS is a common choice. Add your SSH key during server creation if the provider supports it.

After the server is created, note:

- Public IP address.
- Username.
- SSH key.
- Provider firewall settings.

Open ports `80` and `443` for HTTP and HTTPS.

## 2. Point your domain at the server

In your DNS provider's settings, create an `A` record:

```text
site.example.com -> YOUR_SERVER_IP
```

Wait for DNS to propagate. You can test with:

```bash
dig site.example.com
```

If you do not have a domain, you can test using the server's IP address, but HTTPS with a trusted certificate is simpler when you have a real hostname.

## 3. SSH into the server

Connect to the server:

```bash
ssh root@YOUR_SERVER_IP
```

Some providers use a different default username such as `ubuntu`. Use the username shown by your provider.

## 4. Install Caddy

Caddy is a good choice for simple static hosting because it can manage HTTPS certificates automatically for real domains.

On Ubuntu, install Caddy using the official Caddy installation instructions for your current distribution.

After installation, confirm it runs:

```bash
caddy version
systemctl status caddy
```

## 5. Create the site folder

Create a folder for the site:

```bash
mkdir -p /var/www/static-site
```

Copy your generated files into that folder.

From your local machine, one common approach is:

```bash
rsync -av ./static-site/ root@YOUR_SERVER_IP:/var/www/static-site/
```

The trailing slash matters: it copies the contents of `static-site` into the target folder.

## 6. Configure Caddy

Edit the Caddyfile:

```bash
nano /etc/caddy/Caddyfile
```

Use a simple static configuration:

```caddyfile
site.example.com {
root * /var/www/static-site
file_server
}
```

Save the file, then reload Caddy:

```bash
caddy validate --config /etc/caddy/Caddyfile
systemctl reload caddy
```

When DNS is correct and ports are open, Caddy will request and manage the HTTPS certificate automatically.

## 7. Test the live site

Open:

```text
https://site.example.com
```

Check:

- The homepage loads.
- Assets load.
- Internal links work.
- Large files download or render as expected.
- No private drafts are accidentally in the folder.
- HTTPS is active.

## 8. Update the site later

To update the site, copy new files to `/var/www/static-site`.

For example:

```bash
rsync -av ./static-site/ root@YOUR_SERVER_IP:/var/www/static-site/
```

If the Caddy configuration did not change, no reload is usually needed for static files.

## 9. Add password protection if needed

Caddy can support basic authentication with extra configuration. You will need to generate a hashed password and update the Caddyfile.

That works, but it is now server configuration. You will also need to decide how to share passwords, rotate them, remove access, and log visits.

For some teams, that control is useful. For many client-review folders, it is extra work.

## 10. Add analytics if needed

A VPS does not automatically give you product-style website analytics.

You can add analytics by:

- Installing a JavaScript analytics tool.
- Running a self-hosted analytics service.
- Parsing web server logs.
- Sending logs to an external service.

Again, this can be powerful, but it means owning more infrastructure.

## When VPS hosting is the right choice

Use a VPS when:

- You need backend code.
- You need a database.
- You need Docker.
- You need custom server software.
- You want root control.
- You are comfortable with DNS, TLS, SSH, security, logs, backups, and updates.

## When Revdoku is simpler

Use Revdoku when:

- The output is a static folder or file bundle.
- You want a live URL without setting up a server.
- You need public, password, or Require Email access. Visitors verify a one-time email code, not a shared password. For plan details, see [access modes](/blog/how-to-choose-the-right-website-access-mode-in-revdoku/).
- You want built-in viewers for Markdown, HTML, CSV, PDF, and other common files.
- You want analytics after sharing.
- You want AI tools such as Claude, Codex, ChatGPT, or local scripts to publish updates into the same workspace.

With Revdoku, the workflow is:

1. Upload or publish the folder to a Revdoku bucket.
2. Publish the bucket as a website.
3. Choose the access mode.
4. Share the URL.
5. Review analytics.

![The same folder published with Revdoku navigation](/assets/blog/publish-static-folder-vps-caddy/published-folder-navigation.webp)

![Revdoku password setting for the same static folder](/assets/blog/publish-static-folder-vps-caddy/access-settings-password.webp)

![Revdoku analytics for the shared static folder](/assets/blog/publish-static-folder-vps-caddy/analytics-after-sharing.webp)

A VPS is the right choice when you need to operate a server.

Revdoku is the right choice when you need to publish a folder.

The Caddy workflow is not difficult for developers, but it is still infrastructure. For AI-generated folders, client reports, static prototypes, and mixed file bundles, Revdoku removes the server work and keeps the URL, files, access controls, and analytics in one place.

## Keep reading

- [Revdoku vs VPS hosting](/compare/vps-hosting/), how the two approaches compare.
- [Best ways to publish AI-generated websites and file folders](/blog/publish-ai-generated-websites/), the full decision guide.

## Sources checked

- Amazon Lightsail pricing: https://aws.amazon.com/lightsail/pricing/
- Hetzner Cloud: https://www.hetzner.com/cloud/
- DigitalOcean Droplet pricing: https://www.digitalocean.com/pricing/droplets
- Caddy documentation: https://caddyserver.com/docs/

Just ask to &ldquo;publish to Revdoku&rdquo; to
publish your HTML pages presentation dashboard app prototype game prototype
as a fast and secure website

from your Codex , Claude or another AI app publish files or folders

Connect
Skill
MCP

Paste this into your AI app.

Copy

Install the Revdoku skill in your AI app.

Copy
npx skills add revdoku/revdoku --skill revdoku -g

Choose your AI app to connect through MCP.

Codex CLI
Claude Code
Other

Copy codex mcp add revdoku --url https://app.revdoku.com/mcp
codex mcp login revdoku

Copy claude mcp add --transport http revdoku https://app.revdoku.com/mcp
claude mcp login revdoku

Transport Streamable HTTP Auth Browser OAuth

Copy https://app.revdoku.com/mcp

Open the MCP setup guide &rarr;

Free · Public or protected · Visitor analytics · Forms and email alerts Building websites for clients? Explore Revdoku for agencies →

---

[View the canonical page](https://revdoku.com/blog/publish-static-folder-vps-caddy/) · [Browse llms.txt](https://revdoku.com/llms.txt)
