Skip to main content
Take a look at the live Drupal demo site. 🚀
Webhaven

Main navigation

  • Home
  • Who it's for
    • For Experts
    • For Agencies
    • For Starters
  • ROI calculator
  • Docs
  • Get Webhaven

Breadcrumb

  1. Home
  2. Webhaven documentation
  3. Get started
  4. Deploying your site

Documentation

  • Documentation
    • Welcome
  • Get started
    • What is Webhaven?
    • Install with DDEV
    • Install without DDEV
    • Webhaven commands
    • Deploying your site
  • Configuration
    • Drupal Canvas
    • Multilingual
    • Site settings
  • Theming
    • Introduction
    • Theme structure
    • Create a custom theme
    • Single Directory Components (SDC)
    • Component structure
    • An example component
  • Handy resources
    • Roadmap
    • What are Drupal recipes?
    • What is a Drupal site template?
    • What is Drupal Canvas?
    • Drupal Canvas vs Layout Builder vs Paragraphs
    • What is DDEV?
    • Useful DDEV commands
    • What is Drush?
    • Useful Drush commands

Deploying your site

You've built your site locally with DDEV, and now it has to go live. 

This page shows one simple way to do that: the first deploy to a server, and every update after that.

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 push

The 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-dev

composer 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.php

3. Create a hash salt

php -r 'echo base64_encode(random_bytes(55));' > salt.txt

4. Copy your database

Locally:

ddev export-db --file=db.sql.gz

On the server:

gunzip -c db.sql.gz | vendor/bin/drush sql:cli

5. Copy your files

Copy web/sites/default/files and private/, for example with rsync.

6. Finish up

vendor/bin/drush deploy

Every deploy after that

Configuration travels through config/sync; your content stays on the server.

git pull
composer install --no-dev
vendor/bin/drush deploy

drush 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.

Previous page Webhaven commands Next page Drupal Canvas

You've seen how it works. Now see what it's worth.

See how much time and money Webhaven saves on every Drupal project.
Calculate my savings
Webhaven
Ship your best Drupal work, faster.

Links

  • Who it's for
  • Get Webhaven
  • Demo
  • Docs
  • Free tools
  • Blog
  • Get in touch

Follow on

  • Our Drupal profile
  • Our LinkedIn profile
© 2026 Webhaven.
All rights reserved.

Legal

  • License
  • Terms of service
  • Privacy policy
  • Accessibility
  • Login
Built with