The reliable production pattern is a small Compose stack: PHP-FPM runs Laravel, Nginx is the only public web service, and database, Redis, workers, and the scheduler stay on a private Docker network. Build an immutable production image, keep writable data in named volumes, terminate HTTPS at Nginx, and deploy with a production-only Compose file rather than the bind-mounted setup used for development.
Antihost offers VPS plans with one-click Docker, NVMe storage and a 14-day free trial.
What the production stack should look like
Docker Compose models the application services, networks, volumes, and (when used) secrets in one YAML file. For Laravel on a single VPS, the usual topology is:
As an Amazon Associate I earn from qualifying purchases.
Recommended Free Tools
| Service | Role | Network exposure | Persistent data |
|---|---|---|---|
| php-fpm | Executes Laravel and serves PHP requests through FastCGI | Private Compose network only | Writable storage and bootstrap/cache as required |
| nginx | Serves static files and proxies PHP requests | Publishes host ports 80 and 443 | Read-only view of files it must serve |
| database | Stores application data | Private network; do not publish by default | Named database volume |
| redis | Cache, sessions, and queue broker when configured | Private network; do not publish by default | Named volume only if Redis data must survive replacement |
| worker | Runs php artisan queue:work |
Private network | Uses the same application image and environment as PHP-FPM |
| scheduler | Runs Laravel’s scheduled tasks | Private network | Uses the same application image and environment |
Compose service names become DNS names on the private network. Laravel should therefore use database and redis as hosts, not localhost. Only Nginx needs a public interface.
Requirements before you deploy
- An Ubuntu VPS with a DNS A or AAAA record that points to its public address.
- SSH access with a non-root administrative account and a tested way to regain access.
- A repository containing the Laravel application, a production Dockerfile, Nginx configuration, and
compose.prod.yaml. - Laravel’s current deployment requirement: PHP 8.3 or newer and the extensions Ctype, cURL, DOM, Fileinfo, Filter, Hash, Mbstring, OpenSSL, PCRE, PDO, Session, Tokenizer, and XML.
- A database plan, a queue/cache plan, and a backup destination separate from the VPS.
- A domain name for HTTPS. The certificate-validation flow described below requires port 80 to be reachable.
Do not copy a development .env file into the image. Supply production values when the container starts, through an environment file kept on the server, your deployment system, or a secrets mechanism. Keep APP_DEBUG=false and use a strong, stable APP_KEY.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
Organize the repository for production
A practical layout separates image definitions from the application source:
docker/
production/
php-fpm/
Dockerfile
nginx/
Dockerfile
default.conf
compose.prod.yaml
.dockerignore
The production Compose file should not mount the whole source tree from the host. Bind mounts are useful for live development, but they make production dependent on an unversioned directory and can overwrite the dependencies installed into the image. Build a known image from a commit instead.
Build a small, deterministic PHP image
Use a multi-stage build. The builder installs Composer dependencies and, if your application has a frontend, compiles its assets. The runtime stage receives only the application, the vendor tree, compiled assets, and libraries needed by PHP-FPM. Alpine can reduce image size, but choose a base compatible with the PHP extensions and libc assumptions of your application.
FROM composer:2 AS vendor
WORKDIR /app
COPY composer.json composer.lock ./
RUN composer install --no-dev --prefer-dist --no-interaction --no-progress --optimize-autoloader
FROM node:22-alpine AS assets
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM php:8.3-fpm-alpine AS runtime
WORKDIR /var/www
RUN apk add --no-cache icu-libs oniguruma libzip libpng libjpeg-turbo freetype
RUN docker-php-ext-install pdo_mysql mbstring bcmath exif pcntl intl opcache
COPY --from=vendor /app/vendor ./vendor
COPY --from=assets /app/public/build ./public/build
COPY . .
RUN chown -R www-data:www-data storage bootstrap/cache
USER www-data
CMD ["php-fpm", "-F"]
The exact package list depends on your application. Install only the extensions and operating-system libraries you actually use, and verify that every extension required by Laravel and your own packages is present. Run Composer in a locked, non-development mode so the image is reproducible. A real project may also need image-processing, database-driver, or internationalization packages not shown in this illustrative file.
Use a .dockerignore to keep local caches, Git metadata, test output, IDE settings, and development-only files out of the build context:
.git
.env
.env.*
node_modules
vendor
storage/logs
storage/framework/cache
storage/framework/sessions
storage/framework/views
tests
.phpunit.result.cache
Never ignore files that the runtime needs. If your deployment process copies built assets or a generated configuration file, include them deliberately and document the step.
Rank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
Configure Nginx to expose only Laravel’s public directory
Laravel must be served from /var/www/public, with requests routed to public/index.php. Serving the project root can expose environment files and other private configuration. The Nginx container can use a read-only mount for the files it serves while PHP-FPM receives the writable application storage.
server {
listen 80;
server_name example.com www.example.com;
root /var/www/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ .php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_pass php-fpm:9000;
}
location ~ /.(?!well-known).* {
deny all;
}
}
Replace the example host names with your domain. The fastcgi_pass target is the Compose service name, so it remains valid when the container IP changes.
Define the production Compose file
This example demonstrates the important controls: a private network, named volumes, health checks, restart policies, no public database or Redis ports, and separate worker and scheduler processes. Adjust images, credentials, and health commands to your versions.
services:
php-fpm:
build:
context: .
dockerfile: docker/production/php-fpm/Dockerfile
env_file: .env.production
restart: unless-stopped
networks: [app]
volumes:
- app_storage:/var/www/storage
- app_cache:/var/www/bootstrap/cache
healthcheck:
test: ["CMD-SHELL", "php -v >/dev/null"]
interval: 30s
timeout: 5s
retries: 3
nginx:
build:
context: .
dockerfile: docker/production/nginx/Dockerfile
depends_on:
php-fpm:
condition: service_healthy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
networks: [app]
volumes:
- app_storage:/var/www/storage:ro
- certbot_etc:/etc/letsencrypt:ro
- certbot_webroot:/var/www/certbot:ro
database:
image: mysql:8.4
env_file: .env.production
restart: unless-stopped
networks: [app]
volumes:
- db_data:/var/lib/mysql
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -u root -p$$MYSQL_ROOT_PASSWORD"]
interval: 10s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
restart: unless-stopped
networks: [app]
volumes:
- redis_data:/data
worker:
image: your-registry/your-app:release
env_file: .env.production
command: php artisan queue:work --sleep=3 --tries=3 --timeout=90
restart: unless-stopped
depends_on:
php-fpm:
condition: service_healthy
networks: [app]
scheduler:
image: your-registry/your-app:release
env_file: .env.production
command: sh -c 'while true; do php artisan schedule:run; sleep 60; done'
restart: unless-stopped
depends_on:
php-fpm:
condition: service_healthy
networks: [app]
networks:
app:
driver: bridge
volumes:
app_storage:
app_cache:
db_data:
redis_data:
certbot_etc:
certbot_webroot:
In a real deployment, worker and scheduler should use the exact image built for the release rather than a moving tag. You can also run them from the same locally built image by assigning a Compose image name during your build. The database health check confirms that the server responds; it does not prove that migrations are complete or that the application credentials work.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →depends_on controls startup ordering and, with health conditions, waits for a service check. It does not coordinate migrations, retry a dropped database connection, or make queue jobs safe during a deploy. Laravel’s database and queue configuration should still use application-level retries and sensible timeouts.
Install Docker on the VPS
On Ubuntu, use Docker’s official apt repository rather than an unreviewed convenience script. Install the documented package set:
Rank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
After the repository is configured and the packages are installed, verify the daemon, enable it at boot, and run the vendor’s test image:
sudo systemctl enable --now docker
sudo systemctl status docker
docker version
docker compose version
sudo docker run hello-world
Add your deployment user to the docker group only if you understand that membership is effectively root-equivalent on the host. Otherwise, use sudo docker consistently or a tightly controlled deployment account.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteHarden the VPS firewall and published ports
Allow SSH and the web ports at both the hosting provider and the operating-system layer. Do not publish MySQL or Redis to the Internet for routine application traffic. Docker warns that published container ports can bypass assumptions made by UFW or firewalld. Filtering must account for Docker’s forwarding rules, commonly by using Docker-compatible iptables policy and the DOCKER-USER chain.
- Permit SSH only from the administrative networks you actually use, where practical.
- Permit TCP 80 for HTTP and ACME validation, and TCP 443 for HTTPS.
- Keep database, Redis, PHP-FPM, and internal metrics ports un published unless a specific, restricted operational requirement exists.
- Test the rules from an external network before closing your current SSH session.
Deploy the first release
- Check out the intended commit on the VPS or pull a versioned deployment bundle.
- Create
.env.productionwith production values. SetAPP_ENV=production,APP_DEBUG=false, a stableAPP_KEY, and the correct database, cache, queue, mail, and URL settings. - Build and start the stack with the production file:
docker compose -f compose.prod.yaml up --build -d - Inspect service state and logs:
docker compose -f compose.prod.yaml ps docker compose -f compose.prod.yaml logs --tail=200 nginx php-fpm database - Run migrations deliberately, with a backup and rollback decision already made:
docker compose -f compose.prod.yaml exec php-fpm php artisan migrate --force - Cache configuration after the environment is correct:
docker compose -f compose.prod.yaml exec php-fpm php artisan config:cache - Check the application through the domain, then verify a health endpoint, a representative authenticated request, a queued job, and a scheduled task.
Configuration caching means Laravel reads the generated cache rather than rebuilding configuration on every request. Re-run it whenever configuration changes, and clear or rebuild related caches as part of the same release procedure.
Set up DNS and HTTPS
Create the DNS A and/or AAAA record for the VPS before requesting a certificate. Confirm that the name resolves to the correct machine and that port 80 reaches Nginx. Ubuntu documents Certbot as the recommended ACME client for this workflow; its Nginx integration can install the certificate directives and reload Nginx.
sudo apt-get update
sudo apt-get install certbot python3-certbot-nginx
sudo certbot --nginx -d example.com -d www.example.com
sudo certbot renew --dry-run
Certificates and private keys must live outside ephemeral application layers. Mount the certificate directory into the Nginx service, restrict its permissions, and reload Nginx after renewal. A successful dry run tests the renewal path but does not replace monitoring; keep an alert for expiry and verify that the renewal hook actually reloads the container or host proxy serving the certificate.
Rank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
Persist files and protect them with backups
Named volumes survive container replacement and are created when docker compose up first runs. They are persistence, not backup. Back up database data and user-uploaded files independently to storage outside the VPS, and periodically perform a restore test.
- Use a database-native dump or snapshot process appropriate to your database engine, in addition to volume-level protection.
- Back up Laravel’s user-uploaded files from
storage/appor the directories your application uses. - Keep backup credentials separate from the application environment and restrict their access.
- Document retention, encryption, restore time expectations, and the exact commands for rebuilding volumes.
Share only directories that need sharing. PHP-FPM needs writable Laravel storage; Nginx should receive a read-only view for serving files. If uploads become large or must be available to multiple VPS instances, evaluate object storage rather than converting the entire application tree into a host bind mount.
Operate queues and scheduled tasks safely
Run queue workers as their own supervised Compose service so a web-container restart does not silently stop background work. Set queue connection, retry, visibility timeout, and worker timeout values consistently. Restart workers after deploying code so they do not continue executing an old release indefinitely.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Laravel’s scheduler needs one invocation every minute. A dedicated scheduler container can loop with schedule:run, or a host cron can invoke that command in the container. Ensure only one scheduler is active unless your scheduled jobs are designed for overlap; use Laravel’s overlap and mutex controls where appropriate. Health checks should test meaningful behavior, not merely that a process exists.
Use a repeatable update and rollback procedure
- Build or pull the new immutable image and record its tag or digest.
- Take the database and upload backups required by the migration risk.
- Start the new image alongside the existing services when your topology permits, or schedule a controlled restart.
- Run the migration plan deliberately. Treat destructive schema changes as a separate, reviewed operation.
- Rebuild Laravel configuration caches and restart workers and the scheduler so every process uses the release.
- Verify HTTPS, health endpoints, logs, queue throughput, scheduled jobs, error rates, and key user flows.
- If the application fails, redeploy the previous image and follow the tested database restore or backward-compatible migration plan. Rolling back containers cannot undo an irreversible database migration.
Compose supplies the service lifecycle model; it does not provide zero-downtime deployment, traffic shifting, observability, backup policy, or migration compatibility. Choose those controls according to traffic, recovery objectives, and data sensitivity.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot the failures that appear most often
Nginx returns 502 Bad Gateway
- Confirm
php-fpmis healthy and listening on port 9000 inside the network. - Check that Nginx uses the service name
php-fpm, not a container IP orlocalhost. - Inspect PHP-FPM logs for missing extensions, permissions, or a crashed worker.
Laravel reports a permission error
Ensure the runtime user owns storage and bootstrap/cache. Do not make the entire application tree world-writable. If a named volume was created by an earlier image with different ownership, correct it in a one-off maintenance container or an image entrypoint designed for that task.
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
The app cannot connect to MySQL or Redis
Use the Compose service names as hosts, verify credentials in the running container, and inspect health status. A healthy database process can still reject the application’s user or database name. Do not “fix” an internal connection by publishing the database port publicly.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Uploaded files work in PHP but not in the browser
Check that Nginx has the same storage path mounted read-only, that its document root is /var/www/public, and that symbolic links and URL generation match your Laravel storage configuration. Review permissions without granting write access to Nginx.
HTTPS validation or renewal fails
Verify DNS, port 80 reachability, provider-level security groups, and the Nginx server name. Check certificate renewal logs and confirm that the renewed files are mounted into the serving container and followed by an Nginx reload.
Self-managed Compose versus a managed Laravel platform
| Decision axis | Compose on your VPS | Managed platform |
|---|---|---|
| Control | Full control of the OS, image, network, and service topology | More opinionated runtime and fewer low-level choices |
| Operations | You patch Docker and Ubuntu, configure TLS, backups, monitoring, and firewalling | The provider may automate some of those tasks, but scope varies by plan and region |
| Deployment | You design image promotion, migrations, health checks, and rollback | Deployment and rollback workflows may be built in |
| Scaling | You add VPS capacity and design replication or orchestration | Scaling options depend on the platform’s architecture |
| Cost | Usually a predictable VPS bill plus your engineering time and backup services | Often a higher service charge in exchange for reduced operational work |
Choose self-managed Compose when you need topology control and are prepared to own patching, recovery, and monitoring. Choose a managed option when avoiding infrastructure administration is more valuable than controlling every container detail.
Production launch checklist
- Docker Engine, Buildx, and the Compose plugin are installed from the official Ubuntu repository and verified.
- The production image contains no development dependencies, local secrets, or source-code bind mount assumptions.
- PHP 8.3 or newer and all Laravel/application extensions are present.
- Nginx serves only
/var/www/publicand passes PHP requests to the PHP-FPM service. - Only SSH, HTTP, and HTTPS are exposed; Docker-aware firewall rules are tested.
- Database and Laravel storage use named volumes, with independent off-host backups and a restore test.
APP_DEBUG=false, a stableAPP_KEY, and production endpoints are loaded at runtime.- Migrations,
config:cache, worker restarts, and scheduler verification are part of every release. - Certbot renewal has been tested, certificates are outside ephemeral layers, and Nginx reloads after renewal.
- Logs, health checks, queue processing, scheduled tasks, and rollback instructions are documented.
The Bottom Line
A production Laravel deployment on one VPS is dependable when the boundaries are explicit: PHP-FPM runs the code, Nginx is the sole public entry point, Compose isolates internal services, named volumes preserve state, and every release includes migrations, cache rebuilding, backups, health checks, and a tested rollback path.
Free tools Windows power users keep installed
One-click scans. No signup required.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




