Sorry, you need to enable JavaScript to visit this website.

How to setup drush aliases for your Drupal 8/9 website

Submitted by abhaisasidharan on Wed, 10/13/2021 - 15:58

Firstly, make sure you have ssh access to the server (dev, test and/or prod). Your ssh command looks something like this: ssh or ssh user@ Drush alias works by using this username and domain/ip address combination to login to the server and execute the command and then return back to your command line. In your project root, create a drush folder and inside it, create a sites folder. Now you put your site alias config in that folder. Name it something like So your aliases defined inside it would be something like the following:

  root: /var/www/html/dev-website/web
  user: ubuntu
    tty: 0

So your alias here would be You can test this by running drush status from the project root folder. The above config is for a server with Linux user named "ubuntu". If you want the drush command to be interactive you can set the tty to 1.

Here's the folder structure.

  |- web/
  | |- modules/
  | |- themes/
  | |- index.php
  |- drush/
  | |- sites/
  | | |- 
  |- composer.json