Deployment
Run Atom with a conventional PHP request lifecycle, such as PHP-FPM or Apache with mod_php. Both setups serve static files from public/ and pass application routes to public/index.php. Keep Composer dependencies, application code, and .env outside the document root.
Production Checklist
- Use PHP 8.4 or newer with the extensions required by your Composer dependencies and your chosen PDO driver if the app uses a database.
- Build the release with its Composer lock file and run
composer install --no-dev --optimize-autoloader. The framework dependency must be available to the server or build environment. - Configure HTTPS and production settings before sending traffic to the app. Apply database migrations as a deployment step when needed.
- Point the web server at the release's
public/directory. Give the PHP process write access to the configured runtime directories only.
Nginx and PHP-FPM
Inside the site's server block, set root to public/. try_files serves existing files and directories and sends other paths to index.php with their query strings. Replace the socket below with the one used by your PHP-FPM pool. Nginx request processing
root /var/www/atom/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /index.php {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
}
location ~ \.php$ {
return 404;
}
location ~ /\. {
deny all;
}
Apache and mod_php
Inside the site's virtual host, set DocumentRoot and enable the front-controller rewrite. This example assumes PHP handling and mod_rewrite are already enabled. Apache serves files and directories directly and rewrites other paths to index.php. Apache per-directory rewrites
DocumentRoot "/var/www/atom/public"
<Directory "/var/www/atom/public">
Require all granted
AllowOverride None
Options +FollowSymLinks -Indexes -MultiViews
DirectoryIndex index.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [END]
</Directory>
Environment
Set production values in the server environment or in a protected .env outside public/. For an HTTPS site that uses sessions:
APP_ENV=production
APP_DEBUG=false
SESSION_SECURE=true
SESSION_HTTP_ONLY=true
SESSION_SAME_SITE=Lax
Configure the database and mail transport if the app uses them. If HTTPS terminates at a separate proxy, configure Trusted Proxies with the proxy addresses you control so Atom can recognize the original HTTPS request.
Writable Data
Grant the PHP process access to the directories it writes to, such as the configured cache, logs, SQLite database directory, or PHP session storage. Keep application code read-only for the PHP process.
Smoke Test
Check a page, a nested route, a static asset, and an unknown URL over HTTPS. For apps with sessions, sign in and submit a protected form. If you disable OPcache timestamp checks, reload the PHP workers after each release so they pick up the new files.