diff --git a/src/assets/screenshots/whp/whp-sites-edit-node.png b/src/assets/screenshots/whp/whp-sites-edit-node.png new file mode 100644 index 0000000..85836b6 Binary files /dev/null and b/src/assets/screenshots/whp/whp-sites-edit-node.png differ diff --git a/src/content/docs/whp/how-to/switching-site-backend.mdx b/src/content/docs/whp/how-to/switching-site-backend.mdx index 0a27d61..b71f12e 100644 --- a/src/content/docs/whp/how-to/switching-site-backend.mdx +++ b/src/content/docs/whp/how-to/switching-site-backend.mdx @@ -1,6 +1,6 @@ --- title: Switching your site's backend -description: Change the web engine (container type) running a site — standard PHP/FPM or the premium LiteSpeed/OpenLiteSpeed tier. +description: Change the container type running a site — standard PHP/FPM, the premium LiteSpeed/OpenLiteSpeed tier, or Node.js. sidebar: order: 6 --- @@ -9,7 +9,7 @@ import { Steps, Aside } from '@astrojs/starlight/components'; import SignIn from '~/content/partials/signing-in.mdx'; import Support from '~/content/partials/support-link.mdx'; -Every WHP site runs inside a container. The **container type** determines the web engine that serves your site's files and runs your PHP code. Most sites use a standard PHP or PHP-FPM container, which handles the vast majority of WordPress and PHP workloads well. If you've enabled the **Optimized Webserver** add-on, you also have access to LiteSpeed/OpenLiteSpeed (OLS) container types — a premium engine known for its built-in full-page cache (LSCache) and lower memory usage under traffic. +Every WHP site runs inside a container. The **container type** determines the engine that serves your site: PHP, LiteSpeed, or Node.js. Most sites use a standard PHP or PHP-FPM container, which handles the vast majority of WordPress and PHP workloads well. If you've enabled the **Optimized Webserver** add-on, you also have access to LiteSpeed/OpenLiteSpeed (OLS) container types — a premium engine known for its built-in full-page cache (LSCache) and lower memory usage under traffic. If you're deploying your own application code instead of PHP, Node.js container types are also available — see [Node.js](#nodejs) below. Switching backends is a one-step change in the Sites editor, but it does briefly restart your container, so plan for a few seconds of downtime. @@ -36,6 +36,7 @@ Switching backends is a one-step change in the Sites editor, but it does briefly 4. Select the backend you want: - **PHP** or **PHP-FPM** options — standard shared webserver tier, suitable for most WordPress and PHP sites. - **LiteSpeed PHP** options (e.g. *LiteSpeed PHP 8.x*) — premium OLS tier. These only appear if the Optimized Webserver add-on is active on your account. + - **Node18**, **Node20**, or **Node22** — for sites running your own Node.js application code instead of PHP. See [Node.js](#nodejs) below before switching to one of these. 5. Click **Save**. WHP recreates the container with the new engine. Expect a brief moment of downtime (typically a few seconds) while the container restarts. @@ -55,6 +56,24 @@ To enable it: 2. Enable it from your [client portal](https://secure.anhonesthost.com/clientarea.php). 3. Once active, the LiteSpeed PHP options will appear in the Container Type dropdown when editing any site. +## Node.js + +Node.js container types (**Node18**, **Node20**, **Node22**) run your own application code instead of PHP — the container starts your app the same way you would locally with `npm start`. They're for React/Next.js servers, Express APIs, and other Node apps, not for WordPress or PHP sites. + + + +A few things behave differently for Node compared to switching between PHP tiers: + +- **No PHP-FPM / LiteSpeed choice.** Node containers bundle their own web server, so the shared-vs-standalone placement option that applies to PHP and LiteSpeed containers doesn't apply here — you won't see that toggle once a Node container type is selected. +- **Higher minimum memory.** Node containers need more headroom than PHP containers. Selecting a Node container type in the editor bumps **Memory per Container** up to at least 512 MB (versus 256 MB for standard PHP). If your account doesn't have that much unused memory in its resource allowance, WHP will tell you and block the change until you free up resources or [upgrade your plan](/whp/add-ons/resource-upgrades/). +- **Optional WebSocket / real-time support.** The Edit Site form has a **WebSocket / real-time support** checkbox alongside the Container Type field. Turn it on if your Node app holds connections open (Socket.IO, live chat, streaming) — it keeps connections alive for up to 6 hours instead of the standard 5-minute timeout. This is unrelated to the container type itself and works whether or not you just switched to Node. + +![Edit Site modal with Container Type set to Node22, showing Memory per Container automatically raised to 512 MB](~/assets/screenshots/whp/whp-sites-edit-node.png) + +Once you've switched and saved, upload your app to the `app/` folder for that domain via SFTP — see [Create a site](/whp/how-to/create-a-site/#where-your-files-go) for the file layout and how WHP starts your app. + ## Before cancelling the Optimized Webserver add-on