The failure usually looks like this. A routine apt upgrade runs on a server that hosts four client sites. PHP moves, or a PHP extension goes missing, or the distro's Node package fights the one a build script expects. Three of those sites had nothing to do with the change, and all three are down. The panel did its job: it installed everything onto the host, exactly as asked. The trouble is that every app on that box shares one PHP, one Node and one database server, and none of them gets a say in when those change.
Forge and Ploi are good at what they do. They take a bare VPS to a working PHP stack, and the way they handle sites, queues and cron is a reasonable default for a lot of teams. This guide is for the moment you decide you want one app's runtime to stop being the host's business. It walks through moving one Laravel app into containers, step by step, with the old site still serving until you are sure. Most of it applies whatever tool you end up using.
Write down what the app takes from the host
Before changing anything, list every thing the app currently borrows from the server. Each one becomes something you pin on purpose:
- PHP and its extensions. php -v and php -m, run as the site's own user. Note the minor version, not just "8".
- Node, if assets are built on the server: node -v and the lockfile you build from.
- Queue workers. ps aux | grep queue:work finds them wherever the panel keeps their config. Note the queues and connection each one uses.
- The scheduler. The cron line that runs php artisan schedule:run every minute, from crontab -l for the site's user.
- The database and Redis, with their exact versions: SELECT VERSION(); and redis-cli INFO server.
- Files on disk: what lives under storage/app, and how big it is.
- The environment: the whole .env, plus the domain, its www twin and how its certificate is issued.
That list is the real scope of the move. Anything not on it is something you will discover at 11pm on cutover night.
Pin every version the host used to choose
Now map each line to an image tag. PHP becomes a base image pinned to the minor version you noted, with the extensions installed in the image rather than on the host. Node moves into a build stage, so it never exists in the running container at all:
FROM node:22-bookworm AS assets # npm ci, npm run build FROM php:8.3-fpm-bookworm RUN docker-php-ext-install pdo_mysql bcmath opcache # COPY the app and the built assets, then serve HTTP
One thing to plan for: php-fpm on its own speaks FastCGI, not HTTP. A container behind a reverse proxy has to answer HTTP on its port, so pair FPM with a web server inside the image, or use a PHP runtime that serves HTTP itself. Whatever you choose, it is now part of the image and versioned with the app.
The database gets the same treatment. If the host runs MySQL 8.0, the container runs mysql:8.0, not "latest". Move first, upgrade later, as its own change with its own backup. Redis follows the same rule. Once this is done, an apt upgrade on the host can change the kernel and Docker, and nothing your app runs on.
Move the data, and decide how long the site is read only
Do the whole move once as a rehearsal while the old site keeps running: dump the live database, restore it into the new container, copy the files, deploy and click around. Time each step. The rehearsal costs no downtime, and it tells you what the real window will be.
The real move is the same steps with writes stopped. Stop the old server's queue workers and its scheduler first, so no job writes after the dump. Then put the old site in maintenance mode with php artisan down, take the dump (mysqldump --single-transaction or pg_dump), copy it across and restore it. Your downtime is that window: from down until DNS points at the new release. Lowering the record's TTL a day ahead and rehearsing first are what keep it short.
In Sproobo the database is a pinned container named svc-<id> whose data lives on a bind-mounted host path, /var/lib/sproobo/services/<id>/data, that you can open with ls. It publishes no port, so you restore over docker exec on the box, using the credentials already in the container's environment:
docker exec -i svc-<id> sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD" "$MYSQL_DATABASE"' < app.sqlFiles move the same way. Give the app a volume for storage/app and its host path is /var/lib/sproobo/apps/<appId>/volumes/<name>, a bind mount, so rsync from the old server lands straight in it. The directory is owned by the host's sproobo user with mode 0750: an image whose PHP runs as root reads and writes it fine, while one that drops to a non-root user may get permission denied. Check that during the rehearsal, not on the night.
Workers and the scheduler become containers too
On the old server, workers were processes a supervisor kept alive and the scheduler was a cron line. In containers both become the same image as the web app, started with a different command: php artisan queue:work for a worker, and php artisan schedule:work for the scheduler, which stays in the foreground and runs the schedule every minute without cron. An entrypoint that reads an environment variable to pick the command keeps it to one Dockerfile.
In Sproobo each of those is its own app with no domain, created with --health-check container. Its health gate checks that the new container stays running through a short stability window, since a worker has no HTTP port to probe. Two consequences follow. Every deploy starts fresh worker containers on the new code, so there is no queue:restart to forget. And for those few seconds the old and new containers overlap, so give scheduled tasks withoutOverlapping(), and make jobs safe to run twice, which is good advice for any queue.
Two details that bite Laravel apps specifically. Volumes belong to one app, so a file the web app writes and a worker reads should live in object storage (Laravel's S3 disk), not on a shared directory. And binding a database injects DATABASE_URL, while Laravel 11 and later read DB_URL in config/database.php, so point that line at the variable you are given. REDIS_URL already matches.
Cut over with the old site still standing
Before touching DNS, test the new release under its real name. With the certificate in place you can do that from your laptop with curl --resolve example.com:443:<new-ip> https://example.com/up (/up is the health route Laravel 11 ships).
The default certificate path, HTTP-01, only works once the domain resolves to the new server. If you want the certificate before traffic moves, switch the app to delegated DNS-01: one CNAME, _acme-challenge.<apex>, and the certificate issues without the A record pointing anywhere new. Then change the apex and www records, and leave the old server up in maintenance mode for whoever still has the old address cached.
That is the one deploy you run by hand. Every deploy after it is safer than a script that runs git pull and composer install in the directory serving traffic. The new release starts in a fresh container beside the old one. A release command such as php artisan migrate --force runs inside it before the health gate, and can be preceded by an automatic dump of the bound database. The gate then probes your health path, and only a healthy release gets the traffic, in one validated proxy reload. A release that never turns healthy never serves a request, and the old container keeps serving. That is the blue-green swap; more on it in Apps and deploys.
What to switch off on the old server, and when
At cutover, the workers and the scheduler on the old server must already be off. Left running, they process jobs against the old database and send every scheduled email twice. This is the step people most often miss, because nothing visibly breaks.
Keep the rest for a while: the old server, its database and its backups, untouched, for as long as it takes you to trust the new one. Restoring from it is your rollback for the whole move. Once you are confident, raise the DNS TTL again, remove the site from the panel and retire the server. Do one app first, and move the next only when the first has been boring for a week.
Doing it with Sproobo
Everything above works with plain Docker and your own scripts. Sproobo is our version of it. One command enrolls a server: it installs Docker, a firewall baseline, a shared Caddy proxy and a single static Go agent that only dials out, over mutual TLS to gw.sproobo.com on 8443, plus outbound 443 and 5000 to cp.sproobo.com for downloads and image pulls. Start on a fresh server next to the panel one: the proxy needs :80 and :443, and when the panel's web server already holds them the bootstrap steps aside rather than fight for the ports.
Builds happen off the box, deploys go through the health gate and the blue-green swap, and durable data stays on bind-mounted host paths you can copy off a machine you already own. It runs on Ubuntu 22.04, 24.04 and 26.04, Debian 12 and 13, and Amazon Linux 2023. If you are still weighing your options, our honest lists of Ploi alternatives and Laravel Forge alternatives include the trade-offs, ours too. When you are ready, sign up and connect one server, following Getting started.