# Hosting a frontend on Plesk

This page gives the steps of [Hosting a frontend](/md/docs/frontend/hosting-a-frontend/), in Plesk Obsidian. The names of buttons can differ a little between versions and hosting companies.

## A subscription of its own

1. Go to **Subscriptions** → **Add Subscription**. Fill in the name of the frontend as the domain, such as `agency.lightbolt.dev`. Give it a system user and password of its own, and a service plan.
2. Point the DNS of that name to the server, with A, and AAAA for IPv6. The addresses of the server are under **Tools & Settings → IP Addresses**.
3. Once the DNS is right, go to **SSL/TLS Certificates** → **Let's Encrypt**. See below.

### Customize and Update & Lock

A subscription takes its permissions from its service plan. To change one for this subscription only, go to the subscription → **Customize**. Change it, and click **Update & Lock**. *Lock* means that this subscription no longer follows changes to the plan. That is harmless, and the right choice for a frontend.

## PHP

Go to the subscription → **Hosting & DNS** → **PHP**, and choose 8.3 or newer. 8.5 is fine.

On the command line, the PHP versions of Plesk are in `/opt/plesk/php/<version>/bin/php`, such as `/opt/plesk/php/8.5/bin/php`. The `php` of the shell can be older.

## SSH, or a scheduled task

- **SSH** is under the subscription → **Hosting & DNS** → **SSH access**. Choose `/bin/bash`, not chrooted.
- Does it say **Forbidden**, or is there no such setting? Then the hosting turned SSH off above your level. That is common on managed Plesk. There is nothing to fix. Install with a scheduled task instead.
- **Scheduled tasks** need *Scheduler management* in the permissions of the subscription, under **Customize → Permissions**. The engine needs a schedule anyway.
- The install file goes in the **top folder** of the subscription, next to `httpdocs`, and never in it. Go to **Scheduled Tasks → Add Task → Run a PHP script**, and then **Run Now**. [Installing a frontend](/md/docs/frontend/installing-a-frontend/) has the details.
- For a task that runs a command every 5 minutes, choose **Run a command**. Then set **Run** to *Cron style*, with `*/5 * * * *`.

## A domain alias for a site

Go to the subscription → **Domain Aliases**, or **Hosting & DNS → Domain Aliases**. Click **Add Domain Alias**:

| Field | Set it to |
| --- | --- |
| Domain alias name | The domain of the site, such as `example.nl`. |
| Synchronize DNS zone with the primary domain | Only when Plesk keeps the DNS of this domain. |
| Mail service | **Off**, unless the mail moves too. |
| **Web service** | **On**. |
| **Redirect with the HTTP 301 code** | **Off**. It is on by default. Then the domain jumps to the own name of the frontend. |

A name can only be on one subscription. Remove it from the old one first. Also check where its mail and DNS live.

## Let's Encrypt, with the aliases

Go to the subscription → **SSL/TLS Certificates**, and click **Install** or **Reissue** under Let's Encrypt:

- Turn **Secure the domain name** on.
- Turn **Include a "www" subdomain** on only when `www.` has DNS too. One name without DNS makes the whole request fail.
- **Secure webmail** can stay off.
- Under **Secure the aliases**, tick every alias. Each new alias needs this again. The certificate only covers the names that were ticked when it was issued.

Without the alias on the certificate, the browser says `ERR_CERT_COMMON_NAME_INVALID`.

## A wildcard for staging hostnames

Staging hostnames are `<site>-<environment>.<frontend>`. See [Hosting a frontend](/md/docs/frontend/hosting-a-frontend/). Do this once per frontend:

1. **Make a wildcard subdomain.** Go to **Websites & Domains → Add Subdomain**. The name is `*`. The document root is the same `httpdocs` as the own domain of the frontend.
2. **Make a wildcard certificate.** Go to the **own** domain of the frontend, not to `*.…`. The page of `*.…` is only a list of certificates, without **Reissue**. Go to **SSL/TLS Certificates** → Let's Encrypt, and tick **Secure the wildcard domain**. Then go to the subdomain `*.…` → **Hosting Settings → Security**, and choose that certificate.
3. Go to **Platform → Frontends → ⋮ → Check the wildcard**.

**Is there no "Secure the wildcard domain"?** Plesk only shows it when it keeps the DNS of the domain itself. Then **Hosting & DNS** has **DNS Settings**. Without it, the DNS lives elsewhere, as on managed Plesk. You then have three ways:

- Ask the hosting to turn on the DNS service of Plesk for the domain. The option then appears, and Plesk renews by itself. This is the best way.
- *DNS — a TXT record (dns-01)* works once. But every renewal, each 60 to 90 days, needs a new TXT record by hand. We do not advise it.
- In the meantime, add each staging hostname as an alias, and issue the certificate again with it ticked. In Plesk, http-01 works without DNS.

## A reseller

When the hosting company prefers not to give admin rights, it can make you a **reseller**. That is under **Resellers → Add Reseller**, with a reseller plan. Good to know:

- When you move an existing subscription under the reseller, you can see **plan sync conflicts**. Examples are antivirus, backups and mailing lists, with *Plan value* Yes and *Available value* No. **OK** takes the available values, and the subscription becomes *Custom*. Nothing that the frontend needs is in that list.
- The permissions of the reseller need at least *Remote access via Plesk API*, *Domain alias management* and *Scheduler management*.
- The admin sets the password of the reseller. If it is forgotten, the admin sets a new one under **Resellers → the reseller → Change Login Info**.

## The REST API key

The REST API of Plesk is at `https://<server>:8443/api/v2/`. A key is sent in the header `X-API-Key`.

- **To make a key**, run this on the server, as admin: `plesk bin secret_key --create -ip-address <IP of the CMS server> -description "Lightbolt CMS"`. The key is bound to the IP of the CMS server. So a stolen key is useless elsewhere.
- **To test it**, call `GET /api/v2/server`. It must give **200**. **Tools & Settings → Remote API (REST)** has a **Playground**. Its *Server response* is the real answer. The table under it only lists examples.
- **What we got while trying:**

| Answer | What it means |
| --- | --- |
| **401** Unauthorized | The key is not accepted. The key of a reseller got this. In our tests, the REST API only took the key of an admin. |
| **403** Permission denied | Logged in, but this account may not use the API. |
| **404** *Can not find client* | Basic authentication with a login that Plesk does not know as an API user, such as an additional administrator. |

The key only goes in `config.php` on the CMS server. Never put it in a chat, an e-mail, the repository or the database:

```php
$config['plesk'] = ['url' => 'https://<server>:8443', 'key' => '<the key>', 'domain' => '<subscription of the shared frontend>'];
```

With the key there, **Platform → Frontends** offers **Do it in Plesk** after you move sites to a frontend. It shows the steps first:

1. each hostname comes off its old subscription;
2. it goes on the subscription of the frontend as an alias, with web on, mail off, and no redirect;
3. the certificate is issued again, for every hostname that the frontend serves.

It stops at the first step that fails. So a certificate is never asked for half a move.

*Also called: Plesk Obsidian, Plesk panel, managed Plesk.*

Last changed 26 November 2026
