VPS hosting
This page is for hosting companies that offer Exponential on a virtual private server (VPS): one virtual machine per customer or per small group of sites, with root or sudo access. It answers which operating system and PHP to put in the image, how the site should be served, which database fits, how to set up users and permissions, and how to divide the work between host and customer.
Contents
- What the sources say about virtual machines
- The base image
- Serving the site
- The database
- Users, permissions and cron
- Who does what
- Checklist
What the sources say about virtual machines
"Cloud virtual machines (Amazon EC2 including Graviton, Google Compute Engine, Azure, Hetzner, DigitalOcean and the rest) are ordinary Linux machines: tier 2 or 3 by their distribution" (Containers, cloud and hosting panels). A VPS from your own platform is the same: its support level is the support level of the distribution you install on it.
| Distribution in the image | Tier | PHP 8 from (per the sources) |
|---|---|---|
| AlmaLinux 9 | 1 (the project's development server) | AppStream (8.0 stock; module streams php:8.1 to php:8.3), Remi (8.0 to 8.5), or Plesk's PHP |
| Red Hat Enterprise Linux 9 and 10, Rocky Linux, Oracle Linux, CentOS Stream 9 and 10 | 2 | AppStream, Remi |
| Debian 12 and 13 | 2 | the distribution (8.2, 8.4) or Ondřej Surý's repository |
| Ubuntu 22.04 and 24.04 | 2 | the distribution (8.1, 8.3) or the ondrej/php PPA |
| Alpine Linux | 2 | apk |
| Fedora, SUSE, Arch, Amazon Linux 2023 and others | 3 | their own packages |
Source: Operating system support. Processor architecture matters only through PHP and the database: x86_64 is tier 1, aarch64 tier 2 (Processor architectures).
The base image
A VPS image for Exponential carries:
- PHP 8.0 or later, for Apache, PHP-FPM and Velocity alike (Velocity runs on 8.0 from its release 0.0.4.54). The newest 8.x your distribution offers is the recommendation; 8.5 is supported (2.2 PHP).
- The required extensions:
dom,libxml,simplexml,xsl,mbstring,iconv,intl,pcre,json,session,zlib, one database extension,gdor ImageMagick; for Velocity alsosockets, withpcntlandopenssl(2.3 PHP extensions). - 64-bit PHP, recommended "for support of more than 30 languages".
- Composer 2 and Git, for installs and updates from source (Composer and Git on servers).
- The same PHP for web and command line. "Both must be of a supported version and have the same extensions" (Command line and web PHP).
On Red Hat Enterprise Linux 9 and its rebuilds, the documented package set for the stock PHP is:
dnf install php php-fpm php-mysqlnd php-gd php-intl php-mbstring php-xml php-pdo php-opcacheThat stock PHP 8.0 runs Velocity too (the el9 rpm installs on it without a module stream). For a newer PHP switch
to another module stream (dnf module reset php, dnf module enable php:8.3, dnf distro-sync). After an installation exists, let it check the machine:
php bin/php/console exp:velocity ext check
php bin/php/console exp:velocity ext install-hint intl xslThe second command prints the package install command for the system it runs on (Finding what is missing).
Serving the site
On a VPS the customer may run long-running processes, so the recommended engine is available:
| Option | When on a VPS |
|---|---|
| Exponential Velocity | the default: no other web server, HTTPS with its own certificates and ACME, persistent workers, response cache |
FrankenPHP (through exp:velocity) | one verified binary with its own PHP |
| Apache or nginx with PHP-FPM | the image already carries a panel or a tuned web server, or the machine only has PHP 8.0 |
Velocity binds 127.0.0.1 on ports 8088 (HTTP) and 8080 (HTTPS) as shipped. To face visitors directly it is set to
Host=0.0.0.0, Port=80 and HTTPSPort=443, started as root; the workers then drop to the site's user
(8.3.5 Address, ports, user and group).
exp:velocity has no command that installs a boot service; Chapter 8 shows a derived systemd unit that runs
exp:velocity start (8.3.11).
Tip
Put the boot service in your VPS image template, with the installation path and the database service in After=
as placeholders your provisioning fills in. Then every customer machine comes back after a reboot.
More: Velocity for hosts, Apache with PHP-FPM, nginx with PHP-FPM.
The database
In the official order: 1. SQLite 3 (the default) · 2. PostgreSQL · 3. MongoDB · 4. MariaDB · 5. Oracle · 6. MySQL. Microsoft SQL Server is known to be possible with additional work at this time.
A VPS serves one site from one machine, which is exactly where 1. SQLite 3 is "a full production database". Choose a server "when more than one machine must write the database", "when many editors publish large changes at the same moment all day, or when you need replication or database-level users and grants"; then 2. PostgreSQL is "the recommended database server" (Database support). The database server can run on the VPS itself or on a separate database machine of your platform.
See Databases in the official order.
Users, permissions and cron
- One user writes. The PHP-FPM pool, the Velocity workers, cron jobs and console scripts all run as the site's
user (8.7.2). Never let workers run as root
(
[ServerSettings] AllowRootWorkers=disabled, the default). - No world-writable files. Set the hardened
[FileSettings]values0770and0660thatsite.inirecommends (13.11). - Cron in the site user's crontab:
crontab -e -u <site user>orphp bin/php/console crontab:editas that user (Chapter 10, Cronjobs).
Who does what
A VPS offer has to say who looks after which layer. The sources do not prescribe a split; these are the options a host usually chooses between:
| Layer | Unmanaged VPS | Managed VPS |
|---|---|---|
| Hypervisor, network, snapshots | host | host |
| Operating system and PHP updates | customer | host |
| Exponential updates (Composer, extensions) | customer | host or customer, as agreed (Managed hosting) |
| Backups of database and files | customer, or host snapshots | host, with restore tests |
| Certificates | customer (Velocity ACME, certbot) | host |
| Monitoring | customer | host |
Warning
A hypervisor snapshot of a running machine is not a substitute for a database backup. For SQLite "never copy a
database file that is in use"; use .backup or VACUUM INTO (Backup and restore).
Checklist
- To do: Distribution of tier 1 or 2, PHP 8.0 or later (PHP 7.4 usable without support) for web and CLI, the same extensions in both.
- To do:
exp:velocity ext checkclean for the features in use. - To do: Velocity with a boot service, or Apache/nginx with PHP-FPM; HTTPS with a CA certificate.
- To do: Database chosen in the official order and documented.
- To do: Everything runs as the site user;
[FileSettings]hardened. - To do: Cron lines for
runcronjobs.phpin the site user's crontab. - To do: Backups of database,
var/storage,settings/override,settings/siteaccess, restored once on another machine.
Related pages
- Choosing a hosting model, Dedicated servers
- Operating systems for hosts
- Checklist: new server
- Chapter 2: Requirements
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.