- Home
- Docs
- Domains & SSL
- Server domain
Server domain
One wildcard record for the server: webhooks without a package, previews, a name for the API.
Give the server a domain of its own — one wildcard DNS record — and Cipi makes the names it needs under it: an address that answers every app's Git webhook, a name for the API, and a URL for the preview of any branch. Your apps keep the domains they have.
sudo cipi server domain set '*.example.com'
| Under the domain | What it is | Why you want it |
|---|---|---|
webhooks.example.com/<app> | The Git webhook of every app, answered by Cipi | Deploy on push with nothing to install in the app |
<app>-<branch>-<random>.example.com | The preview of a branch | A live copy of a branch, with its own database, gone when the branch is deleted |
api.example.com | The name sudo cipi api suggests | One less name to invent when you install the REST API |
The domain is optional. A server without one works as it always did.
1. Create the DNS record#
At your DNS provider, add one wildcard record that points at the server:
| Type | Name | Value |
|---|---|---|
A | * | the server's IPv4 address |
AAAA | * | the server's IPv6 address, if it has one |
That makes every name under example.com reach the server. You can also keep it a level down, so that nothing else under your domain is touched:
| Type | Name | Value | Cipi's domain |
|---|---|---|---|
A | *.cipi | the server's IPv4 address | *.cipi.example.com |
Both forms work the same way. Use the second when example.com already has other subdomains you don't want Cipi near.
A wildcard record does not override the records you already have: www.example.com or mail.example.com keep pointing where they point. It only answers for names nobody defined.
2. Set the domain#
sudo cipi server domain set '*.example.com'
# a level down works the same way
sudo cipi server domain set '*.cipi.example.com'Write the record with or without its *.: example.com means the same. Quote it, so the shell doesn't expand the *.
Cipi asks the DNS for webhooks.example.com and for a random name nobody created. Both must reach this server: that proves the record is a wildcard and that it points here. If not, it stops and tells you which record is missing.
The domain is saved in the server's own configuration.
Cipi creates webhooks.example.com, with one location per app, and asks Let's Encrypt for its certificate.
Webhooks Cipi registered on GitHub, GitLab or Gitea are moved to the new address. Webhooks you added by hand are listed, with the URL to set.
A small job starts checking whether the branch of a preview still exists.
| Option | When to use it |
|---|---|
--skip-dns-check | The server sits behind a proxy or a load balancer and can't see its own public address |
--no-ssl | You want to set the domain now and get the certificate later. Git providers call https, so run the command again without it before you rely on the webhooks |
Check the result at any time:
sudo cipi server domain
It shows the domain, the webhook address with the state of its certificate, the apps that answer there, and the previews under the domain.
The installer asks for the domain too, as an optional step. You can leave it empty and set it later.
What changes for your apps#
Nothing changes in how an app is served. What changes is who answers the Git webhook:
| App | Without a server domain | With a server domain |
|---|---|---|
Laravel, without cipi/agent | No webhook: pushes don't deploy | Cipi answers at webhooks.example.com/<app> |
Laravel, with cipi/agent | The agent answers at https://<app domain>/cipi/webhook | The same: the agent comes first wherever it is installed |
| WordPress, Symfony, Node, Laravel Rust, custom | Cipi answers on the app's own domain | Cipi answers at webhooks.example.com/<app> |
So the Cipi Agent becomes optional: install it for what only it does — the health endpoint, the MCP server, the database anonymizer — not to deploy on push.
Cipi keeps the webhook on your Git provider in step by itself. Add the agent to an app, or remove it, and the next deploy moves the webhook to the right address.
sudo cipi app webhook show myapp
shows where the webhook of an app is, who answers it and its secret. See Auto-deploy on push.
Change or remove the domain#
# move to another domain: set the new one sudo cipi server domain set '*.other-domain.com' # write every app's webhook address again (after editing nginx by hand) sudo cipi server domain sync # remove it sudo cipi server domain remove
| When you | What happens |
|---|---|
| Set another domain | The webhook address moves, with a new certificate. Refused while previews live under the present domain: delete them first |
| Remove the domain | The webhook address and its certificate are removed. Webhooks go back to each app's own domain — where a Laravel app needs cipi/agent again to deploy on push. Refused while previews exist |
From the panel, the API and the CLI client#
| Where | How |
|---|---|
| Web panel | Server → Domain: type the wildcard record, save. The job shows the DNS check and the certificate as they happen |
| REST API | GET, PUT, DELETE /api/server/domain, POST /api/server/domain/sync |
| CLI client | cipi-cli server domain, server domain set '*.example.com', server domain remove |
| PHP SDK | $cipi->serverDomain()->show(), ->set('*.example.com'), ->remove() |
Common problems#
| Problem | Cause | Fix |
|---|---|---|
| does not resolve yet | The record was just created, or has a typo | Wait a few minutes and run the command again. Check with dig +short webhooks.example.com |
| is not a wildcard | You created webhooks.example.com only | Create the * record: previews need any name to reach the server |
| resolves to another address | The record points elsewhere, or a proxy answers for it | Point it at this server. Behind a proxy that hides the server: --skip-dns-check |
| is a domain of app … | An app already uses webhooks.example.com | Give that app another domain, or use a level down: *.cipi.example.com |
| No certificate yet | Let's Encrypt couldn't reach the server when the domain was set | Run sudo cipi server domain set again with the same domain |
| The provider still calls the old address | You created the webhook by hand | sudo cipi app webhook show myapp gives the URL to set on the provider |
Questions#
| Question | Answer |
|---|---|
| Do I need a wildcard certificate? | No. Cipi asks one normal certificate for webhooks.example.com, and one for each preview when it is created. No DNS API token is needed |
| Can two servers share one domain? | Not the same record: a name reaches one server. Give each its own level: *.eu.example.com, *.us.example.com |
| Does it expose anything new? | One HTTPS address that accepts signed pushes and nothing else. Every app has its own secret, and a request with a wrong signature is refused |
| Is this the same as an app with a wildcard domain? | No. That is one app answering every subdomain (tenants). This is the server's own domain, used by Cipi |
| Can I still use the agent's webhook? | Yes. Where cipi/agent is installed, its address is the one Cipi registers |