# Guide

How to publish a static website in a few seconds.

## How to publish a site

1. On the [home page](https://freepages.dev/), drag your site's folder into the marked area, or click **Add folder**. The first folder becomes the root of the site.
2. In the file tree you can adjust the site: add more files or folders, create a **new folder**, move files and folders by dragging, rename them (double-click) or remove them. More options, such as replacing a file or a whole folder, are under the **⋯** button of each item.
3. The site name is filled in from the first folder's name (without a folder, a random code is generated). If you want a different one, type it into the **address bar** above the upload area.
4. Click **Preview** to look at the site first at a temporary `preview-…` address. The preview expires after 5 minutes.
5. Enter your e-mail, first and last name and click **Send confirmation**. You will get a link by e-mail; once you open and confirm it, the site is online and your account is created. The link is valid for 24 hours.

If you already have an account and are signed in, the site is published right away without confirmation.

The site will be available at `https://{name}.freepages.dev/`

## What the folder should contain

- Ideally a start page `index.html`. It is not required: without it the only HTML page in the folder is shown, or a subfolder with an `index.html` (such as `dist/`), or a list of files.
- Anything else: CSS, JavaScript, images, fonts, subfolders. The structure is kept as it is.
- Only static files work. PHP, Node.js and databases are not run.
- Sites made with a framework (React, Vue, Svelte, Angular, Astro, Next.js, Nuxt, Vite…) can be published too: build them first (for example `npm run build`; SvelteKit with `adapter-static`, Next.js with `output: 'export'`) and upload only the resulting folder, typically `dist/`, `build/` or `out/`, not the source code and `node_modules`.
- Avoid putting personal data on your site unless it needs to be public, whether your own or anyone else's. The site is public and you are responsible for its content, see the [terms of use](https://freepages.dev/podminky).

```
my-site/
├── index.html
├── about.html
├── css/style.css
└── img/logo.png
```

If you upload a folder that only contains one other folder (for example `my-site/dist/…`), its contents are published automatically.

## Uploading a .zip file

Instead of a folder you can upload a single `.zip` file. When you add it, you are asked whether to extract it and publish it just like a folder, or upload it as a file to download. Handy for large sites or browsers that cannot upload folders.

## Account and signing in

- You can create an account on the [Account](https://freepages.dev/ucet) page without uploading a site, or it is created when you first publish.
- Accounts have no password. Sign in on the [Account](https://freepages.dev/ucet) page with a link we send you by e-mail.
- Your account shows your sites, personal details, API keys and activity history.

## Editing a site

Under [My sites](https://freepages.dev/#my-sites), click **Edit**. The site's files open in the tree: you can replace single files, replace a folder's contents or the whole site with another folder, add files and folders, move and remove them. Check the changes in a **preview**, then click **Save changes**. The switch happens at once, so visitors never see a half-uploaded site.

## Deleting a site or account

Delete a site with its **Delete** button, and your account on the [Account](https://freepages.dev/ucet) page (you confirm with a link sent by e-mail). Deleted sites stop being public immediately. We keep the data for 90 more days to deal with possible abuse and then delete it permanently; to have it deleted right away, write to [martin@freepages.dev](mailto:martin@freepages.dev).

## API keys

Create a key under [Account → API keys](https://freepages.dev/ucet#api-klice). You use it on the command line and with MCP. A key only sees and changes your account's sites, and you can revoke it there at any time.

### Command line (curl)

Publish and update a site, e.g. from a script or CI:

```
# publish or update a site from a .zip file
curl -H "Authorization: Bearer $FREEPAGES_TOKEN" \
     -F name=my-site -F overwrite=1 -F f=@site.zip \
     https://freepages.dev/api/sites
```

- `name`: the site name. Without `overwrite=1` a taken name gets a suffix; with it, your existing site is replaced.
- `f`: files. A single `.zip` is extracted (with `-F unzip=0` it stays a file); send several files as pairs `-F p=path/file.html -F f=@file.html` (the path `p` always before the file).
- `preview=1`: creates a 5-minute preview instead of publishing; its address is in the response. A new preview of your account deletes the previous one.
- The response is JSON with the site's address (`url`). Errors return `{"error": "…"}` with a 4xx HTTP status.
- `GET /api/whoami` with the same header tells which account the key belongs to: e-mail, name, key name, number of sites and storage used.

### MCP server for AI assistants

An AI assistant (Claude, Cursor, VS Code and others) can publish sites too. Add an MCP server with the address `https://freepages.dev/mcp` in the app. The app signs in by itself: it opens a window where you enter your e-mail, and you confirm access with a link in the e-mail (which also creates your account if you do not have one). If you are signed in in the browser, just click **Allow access**.

```
# Claude Code
claude mcp add --transport http freepages.dev https://freepages.dev/mcp
```

Apps without sign-in (OAuth) connect with an API key in a header:

```
# Claude Code with an API key
claude mcp add --transport http freepages.dev https://freepages.dev/mcp \
  --header "Authorization: Bearer $FREEPAGES_TOKEN"
```

```
# Cursor, VS Code and others (JSON configuration)
{ "mcpServers": { "freepages.dev": { "type": "http", "url": "https://freepages.dev/mcp",
  "headers": { "Authorization": "Bearer $FREEPAGES_TOKEN" } } } }
```

The assistant can then:

- publish or update a site from files (`publish_site`) and create a preview (`create_preview`),
- tell which account it is connected to (`get_account`),
- list your sites and their files and read a file (`list_sites`, `list_files`, `read_file`),
- rename and delete a site (`rename_site`, `delete_site`) and check visits (`get_visits`).

Agents find an overview of the service in [/llms.txt](https://freepages.dev/llms.txt). The guide, terms and privacy policy are also available as Markdown: [/docs.md](https://freepages.dev/docs.md?lang=en), [/podminky.md](https://freepages.dev/podminky.md?lang=en), [/soukromi.md](https://freepages.dev/soukromi.md?lang=en). The API is described in [/openapi.json](https://freepages.dev/openapi.json).

## Password sites

From IP addresses allowed by the administrator, sites can be published without an account. Such a site gets a password (for example `k7mq-2xpa-9fve`), saved in your browser; without it the site cannot be replaced or deleted. On another device, add it with **Add a password site**.

## Clean URLs and error page

- The address `/about` serves `about.html`; you don't have to type the extension.
- Add a `404.html` file and it is shown for pages that don't exist.
- A folder without `index.html` shows its only HTML page, otherwise a list of its files.

## Name rules

- Lowercase letters without accents, numbers and dashes, at most 63 characters.
- Capitals, spaces and accents are converted automatically (`My Site` → `my-site`).
- If the name is already taken, a dash and three random characters are added, for example `my-site-k3x`.
- Some names are reserved, for example `admin`, `api`, `docs` or `www`, and names starting with `preview-`.

## Limits

- Maximum size of one upload: **100 MB**
- One site can have at most **50 MB**, and all sites of one account together **100 MB**. Deleted sites do not count towards the account limit.
- You can have one preview at a time: a new preview deletes the previous one right away.
- System files such as `.DS_Store`, `Thumbs.db` or `__MACOSX` are skipped.
