# Add a site

> Site types, domains and aliases, and everything on a site's page.

Open a server and choose **Sites**. The server's **Web stack** must be installed first, in its own section (see [Web stack](/docs/web-stack)); then choose **Add site**, or install a [one-click app](/docs/one-click-apps).

## Add a site

| Field | What to enter |
| --- | --- |
| Domain | The main domain, e.g. `shop.example.com`. Point its DNS to the server first. |
| Aliases (optional) | Other names for the same site, e.g. `www.shop.example.com`. Wildcards (`*.example.com`) need DNS-01 validation. |
| Runs on | The site type (below). |
| Linux user | Derived from the domain unless you choose one. |
| Web root (optional) | The folder the web server serves, e.g. `public` (Laravel sets this for you). |

## Free zefily.app address

No domain yet, or want a test address? Under **Domain**, **Use a free zefily.app address** fills in a name such as `site-k3x9q.zefily.app` (change the first part if you like: 3–50 letters, digits and hyphens). A free address can also be added as an alias of a site that has its own domain.

Zefily creates the DNS record in its own zone, pointing at your server, and your server gets its own certificate for the name (HTTP-01, port 80) — no DNS setup on your side. The site's **General** pane shows **Free address** with **DNS ready** (or why not yet). Deleting the site or removing the alias releases the name and its record.

Good to know:
- `zefily.app` is separate from zefily.com. Sites on `zefily.app` addresses share a cookie domain with other customers' sites until the domain is on the Public Suffix List, so do not rely on cookies set for `.zefily.app`; for production use your own domain.
- A site with a free address validates its certificate over HTTP, not through a DNS provider account.
- Names that look like a panel, a mail service, a login page or a payment page are blocked (www, root, admin, webmail, phpmyadmin, giris, yonetim and many more, including names that contain them such as shopadmin), and each name belongs to one site.

## Site types

- **PHP** — any PHP app, Laravel, WordPress. Pick the PHP version per site.
- **Static files** — HTML, CSS and JavaScript served directly.
- **Node.js** and **Python** — the app runs as a managed service on a local port; the web server forwards the domain to it. See [Node.js and Python apps](/docs/node-python-apps).
- **Reverse proxy (local port)** — forwards the domain to an app already listening on `127.0.0.1`.
- **Container (Docker)** — a registry image, your repository's Dockerfile, or a Compose file, run rootless. See [Containers and Compose](/docs/containers).

Every site gets **its own Linux user**, its own PHP pool or service and its own directory (`/home/<user>/sites/<domain>`), so one site cannot read another's files.

## The site page

Click a site to open it. The tabs are:

| Pane | What it holds |
| --- | --- |
| General | Runtime and Linux user, [HTTPS and certificate](/docs/https-certificates), [caching and protection](/docs/access-and-caching), uptime |
| Deploy | [Git deploys](/docs/deploy-from-github), the `.env`, Laravel scheduler and workers, the start command of apps |
| WordPress | [WordPress tools](/docs/wordpress) (instead of Deploy for WordPress sites) |
| Database | [Connect a database](/docs/databases) |
| PHP | [Limits and php.ini settings](/docs/php-settings) |
| nginx | [Your own nginx directives](/docs/custom-nginx) (nginx servers) |
| OpenLiteSpeed | [Your own OpenLiteSpeed rules](/docs/custom-openlitespeed) (OpenLiteSpeed servers) |
| Logs | [Access, error, PHP, Laravel and app logs](/docs/logs-and-env) |
| Access | [Password protection, IP rules, canonical host](/docs/access-and-caching) |
| Danger zone | Take the site offline |

The site row on the list also shows its uptime, HTTPS state and, for one-click apps, the app, **Admin panel** and **Show admin login**.

## Suspending a site

Owners and admins can suspend a site under **Danger zone → Suspend site** — for example a hosting client who has not paid. Visitors then get a neutral maintenance page (HTTP 503), the site's cron jobs and processes stop, and deploys wait. Files, databases and settings stay as they are. The reason you enter is for your team only; the site page shows it with **Unsuspend**, which brings everything back. While the site is being installed or deployed, the panel and the API wait with the suspension until that job has finished, so no installer keeps writing to a suspended site.

## Moving a site to another server

On the site page, **Danger zone → Move to another server** moves the site to another server of your organization in two steps:

1. **Copy.** The site is set up on the new server (without HTTPS for now), and its directory and its linked database are copied there through an encrypted transfer — the database with the same name, user and password, so the site's configuration keeps working. The site keeps serving from its current server meanwhile; the page shows the progress.
2. **Switch.** When the copy is ready, **Switch to the new server** starts the final copy. The site goes offline on the old server, its changed files and its database are copied again, and both sides are compared before anything moves: the files by a manifest of their names, sizes and SHA-256 hashes, the database by the rows of every table. Only when both match does the site hand over: its cron jobs and processes move, the old server takes the site offline (once the new server serves it, Zefily asks you to approve with your passkey the removal of its old files and database there), and HTTPS keeps working on the new server at once: the site's certificate and key are copied with it, so no new certificate is needed. A site without one gets a certificate there, which can take a few minutes while DNS settles. Domains in a Cloudflare zone of your account are pointed at the new server automatically; otherwise point them at the address the page shows.

The same move is in WordPress Studio, in its Tools tab, and it works for every site type.

A **Compose site** moves too, with its named volumes (where a database in a container keeps its data) and the data of its bind directories. The stack stops for the final copy, so nothing writes to its data while it is copied, and it starts again on the new server with the same data. Both servers need the newer agent for this: until both have it, the move asks you to update first.

**The site is offline from the start of the final copy until the switch**: visitors see its maintenance page, and its cron jobs and processes stop. How long that takes depends on the size of its files and database and on the link between the two servers; the page shows the step it is on. The final copy sends only the files that changed since the first copy, so a large site with few changes is offline for less time. Nothing written during the copy is lost, because the final copy carries everything written before the switch. Deploys and edits of the site wait until the move ends. If the final copy fails or the two sides do not match, nothing is switched: the site is back in service on the old server, and the page says why. A move that makes no progress for two hours stops the same way. You can then switch again, or **Cancel the move**, which removes the copy from the new server and keeps the site where it is. A move from before the final copy existed keeps its old copy until you delete it with **Delete the old copy** and your passkey. A new move to a server where a cancelled move left its copy replaces that copy, files and database, unless the site or its database was used there since; a database of the same name that is not that copy still stops it. Both servers need a current agent. A Git deploy key, if you use one instead of the GitHub app, has to be added again for the new server.

## Taking a site offline

**Danger zone → Take offline, keep files** removes the site from the web server and its PHP pool but keeps its files and user, so you can restore it. **Delete with all files** removes the site and needs your passkey. Its files do not vanish at once: they move to a protected trash on the server (root only) and are kept **for seven days**, then the server deletes them automatically. The result of the removal names the place and the date. Tick **Delete permanently now (no trash)** to delete them at once. Without that tick, the space comes back after the seven days, or sooner: open the server's **Disk** tab and delete the entry in its **Trash** section (see [Updates and services](/docs/updates-and-services)). Until the seven days pass, an administrator on the server can restore them (see below); the panel offers no restore button. Both stop and remove the site's own background processes too: its web process, queue workers, scheduler and cron jobs. A linked database is removed with the site only when you tick it; it is dumped into the same trash first, unless you delete it at once. Other databases are separate: delete them under **Databases**. When the site's Linux user is shared with other sites or server users (so the account stays), deleting at once also removes the site's own containers, the images built for it, its named volumes and its Compose networks, which frees their space. Containers of other sites stay, and the removal log lists them. Without the tick, those containers and volumes stay on the disk.

### Restore removed files by hand

As root on the server, each removal has an entry in `/var/lib/zefily-agent/trash/` (on a disk that holds the home folders: `/home/.zefily-trash/`). Its `trash.json` names the site, the time it was removed and the time it expires:

```
sudo ls -la /var/lib/zefily-agent/trash/
sudo cat /var/lib/zefily-agent/trash/<entry>/trash.json
```

Put the site's files back with `sudo mv /var/lib/zefily-agent/trash/<entry>/site /home/<user>/sites/<domain>`. If the Linux account was removed too, its folder is in the entry as `home`: recreate the account with the same user name and the numeric owner shown by `sudo ls -ln`, then `sudo mv <entry>/home /home/<user>`. Restoring puts the files back only: add the site again in the panel. The agent deletes an entry when its `expires_at` has passed; you can delete it earlier with `sudo rm -rf` on the entry, but only when you no longer need the data.

## DNS is spreading

A new name can take a while to resolve. While its record is not visible yet, the site shows "DNS is spreading" instead of
"Down", and Zefily checks the zone again until the record is there. Once it resolves, the site is checked as usual.

---
Source: https://zefily.com/docs/add-a-site
