What your server needs
The same as Install without DDEV: PHP 8.3+, Composer, MySQL or MariaDB, and a web server with its document root pointed at web/.
You don't need Node there: your theme's built files are committed.
Before you deploy
Build your theme for production, export your configuration and commit both:
npm run build # in your theme folder
ddev drush cex
git add -A && git commit -m "Ready to deploy" && git pushThe first deploy
Your pages, menus and media live in the database, so the first time you copy the database and files across.
1. Get the code onto the server
git clone <your-repository> my-site
cd my-site
composer install --no-devcomposer install creates web/sites/default/settings.php.
2. Add your database credentials
Add your credentials at the end of web/sites/default/settings.php
$databases['default']['default'] = [
'driver' => 'mysql',
'database' => 'database',
'username' => 'user',
'password' => 'password',
'host' => 'localhost',
];Then make the file read-only:
chmod 444 web/sites/default/settings.php3. Create a hash salt
php -r 'echo base64_encode(random_bytes(55));' > salt.txt4. Copy your database
Locally:
ddev export-db --file=db.sql.gzOn the server:
gunzip -c db.sql.gz | vendor/bin/drush sql:cli5. Copy your files
Copy web/sites/default/files and private/, for example with rsync.
6. Finish up
vendor/bin/drush deployEvery deploy after that
Configuration travels through config/sync; your content stays on the server.
git pull
composer install --no-dev
vendor/bin/drush deploydrush deploy runs the database updates, imports your configuration and clears the caches.
More advanced setups
Larger sites often deploy from a CI pipeline, for example in GitLab, with automatic backups before every deploy or zero-downtime releases.
That's beyond this page.
Need help setting one up? I offer Drupal consultancy.