Drupal 7 Advanced Training
Illustration by John Hersey

Installing Drupal using Drush


Drupal 7 Advanced Training

with Tom Geller

Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now

Video: Installing Drupal using Drush

In the last video we installed Drush on the UNIX web host. Now it's time to actually make it do something and what better way to start than with a fresh Drupal installation. I've already created a place for it at drush.tomgeller.com and created a database called tgeller_drush. In the last video we modified our environment so we can call up Drush simply by typing drush, no matter where we are on the web host. And you can see that by typing right now to drush help and we get the help command.
Expand all | Collapse all
  1. 4m 51s
    1. Welcome
      1m 7s
    2. Planning your Drupal career
      3m 44s
  2. 25m 46s
    1. Comparing development and production environments
      6m 22s
    2. Configuring your settings.php file
      7m 10s
    3. Running multiple sites from one Drupal installation
      7m 32s
    4. Troubleshooting common issues
      4m 42s
  3. 51m 20s
    1. Understanding your Drupal site's place on the web
      2m 44s
    2. Selecting a web host
      7m 20s
    3. Using Unix's command-line interface
      8m 23s
    4. Working with your web host's access restrictions
      4m 51s
    5. Using cPanel and other graphical web host interfaces
      3m 40s
    6. Transferring files to and from your web host
      5m 49s
    7. Moving databases using phpMyAdmin
      6m 34s
    8. Moving databases using Unix commands
      6m 8s
    9. Modifying server configuration files
      5m 51s
  4. 27m 11s
    1. Learning from case studies
      3m 13s
    2. Planning your site
      4m 18s
    3. Populating your site with Devel Generate
      3m 43s
    4. Managing URL paths
      3m 20s
    5. Restricting access to downloadable files
      5m 55s
    6. Reusing site components with the Features module
      6m 42s
  5. 21m 54s
    1. Understanding and installing Drush
      5m 23s
    2. Installing Drupal using Drush
      7m 24s
    3. Building a site using Drush
      9m 7s
  6. 32m 0s
    1. Backing up with the Backup and Migrate module
      8m 17s
    2. Moderating comment spam
      6m 47s
    3. Migrating from Drupal 6
      4m 28s
    4. Migrating to Drupal 7
      12m 28s
  7. 22m 24s
    1. Letting users log in through OpenID
      5m 10s
    2. Letting users log in through Facebook, Twitter, and other services
      9m 43s
    3. Republishing posts on Facebook and Twitter
      7m 31s
  8. 1h 5m
    1. Understanding Drupal's base themes
      5m 55s
    2. Introducing base themes: Zen and subtheming
      11m 35s
    3. Introducing base themes: Fusion and extensibility
      10m 44s
    4. Introducing base themes: AdaptiveTheme and responsive design
      7m 25s
    5. Introducing base themes: Omega and mobile devices
      7m 9s
    6. Using Firebug and other theming tools
      7m 20s
    7. Modifying themes with Sweaver
      6m 59s
    8. Modifying themes with Livethemer
      8m 45s
  9. 49m 36s
    1. Understanding the Rules module
      6m 49s
    2. Demonstrating how Rules works in Drupal Commerce
      3m 53s
    3. Creating practical rules
      6m 37s
    4. Improving rules
      9m 10s
    5. Defining conditions with the Context module
      7m 51s
    6. Varying layout with the Context and Delta modules
      5m 0s
    7. Varying layout with the Panels module
      10m 16s
  10. 52m 46s
    1. Enabling social features
      9m 46s
    2. Implementing a voting system
      9m 15s
    3. Rewarding good behavior with the Userpoints module
      5m 57s
    4. Setting up Organic Groups
      6m 28s
    5. Adding content to groups
      2m 21s
    6. Seeing group activity better with views and panels
      10m 13s
    7. Making groups private
      4m 54s
    8. Letting each group have its own permissions
      3m 52s
  11. 25m 32s
    1. Understanding packaged Drupal distributions
      2m 8s
    2. Getting a head start with Acquia Drupal
      7m 28s
    3. Creating online storefronts with Drupal Commerce
      6m 53s
    4. Creating government web sites with OpenPublic
      9m 3s
  12. 1h 30m
    1. Taking the assignment
      3m 26s
    2. Planning the project
      3m 43s
    3. Preparing the infrastructure
      8m 42s
    4. Starting the design
      7m 35s
    5. Filling in the content
      7m 29s
    6. Developing the layout
      10m 27s
    7. Finishing the layout
      7m 8s
    8. Refining the CSS
      6m 32s
    9. Setting up sections for regional offices
      4m 53s
    10. Configuring regional offices
      7m 18s
    11. Connecting to social media
      5m 9s
    12. Cleaning up
      12m 32s
    13. Securing the site
      5m 56s
  13. 37s
    1. Next steps

please wait ...
Watch the Online Video Course Drupal 7 Advanced Training
7h 50m Intermediate May 17, 2012

Viewers: in countries Watching now:

This course teaches web site designers how to take their sites to the next level with a few advanced techniques and the free and open-source Drupal software. Author Tom Geller shows how to configure the most popular add-on modules; use *nix commands and an FTP program to manage a Drupal site on a web server; change its visual appearance using the latest graphical tools; automate and speed through common tasks with Drush; integrate with social media sites; and see how "supermodules" like Panels, Context, Rules, and Features open up new worlds of code-free development.

Drupal 7 Advanced Training was designed as a follow-up to Drupal 7 Essential Training and it also dovetails nicely with our other Drupal courses, such as Drupal 7 Reporting and Visualizing Data and Create Your First Online Store with Drupal Commerce.

Topics include:
  • Moving a site from the development environment to production
  • Hosting a Drupal site
  • Moving databases with phpMyAdmin and Unix commands
  • Making site administration more efficient with Drush
  • Backing up site data
  • Moderating comments
  • Migrating from previous versions of Drupal
  • Working with themes
  • Creating variable layouts
  • Enabling social features
  • Creating an online store with Drupal Commerce
Developer Web
Tom Geller

Installing Drupal using Drush

In the last video we installed Drush on the UNIX web host. Now it's time to actually make it do something and what better way to start than with a fresh Drupal installation. I've already created a place for it at drush.tomgeller.com and created a database called tgeller_drush. In the last video we modified our environment so we can call up Drush simply by typing drush, no matter where we are on the web host. And you can see that by typing right now to drush help and we get the help command.

We can see where we are by typing pwd and we're in my home directory. So we're ready to begin. Although we won't use the web interface, I'll bring it up in a browser so we can see how every thing's going. I'll go to drush.tomgeller.com and we have simply an empty directory. In fact, I'm going to go back to my terminal and go to where that Drush site lives; that's cd webapps in my case, lyndadrush, and as you see it's empty.

First, we need to download Drupal. One thing to watch out for, unless you tell it otherwise, Drush assumes you want to deal with the site where you currently are. I've sometimes moved from one directory to another in the UNIX command line only then to apply Drush changes to the wrong site. So before we get started one more time I'm going to just be sure, pwd, yup, lyndadrush that's the directory I want. The command we use is Drush Download, which is simply drush dl. That takes a few minutes and it doesn't give you any visual sign that it's happening, but once it's done it tells you, yup, you've got it and here is all the things I did.

If we do it an ls, there's the folder. As usual I'll go into that folder and move everything up one level. You might not have to do this depending on how you have your web host configured. In my case, I'm only able to do that inside a folder so I have to take this extra step. Move everything up one. See what else is left, and then move those things. Make sure the directory is empty, go back up, and get rid of that directory.

Now if we go back to our browser, we see the usual installation screen. I'll just go back and reload the browser, but I'm not going to use this screen, instead I'll run the installer within Drush. I go back to the terminal and use the command site-install, which has a lot of options. Now we could look those up on drush.org in the browser. In fact, if we go to drush.org you see all of these things that go with version 5, which is the version we're using, and then we could go down and look for that site-install, and you'll see all of these options.

But another way to do it and one that I actually think is better is to look up the documentation within Drush itself. That way you're always sure that you're looking at the correct version of Drush , since it's getting it directly from the Drush program you have installed. To do that I'll do drush help site- install, and there are all the options. We can scroll up and see there are quite a lot of them. But only one option is really mandatory. That's the one that provides the database details. So here we go.

The command is drush site-install and then the option is --db-url= and then you add all of the details. First it's mysql://, followed by your username, which is tgeller_drush in this case, and the password, which in this case I use dbpass, followed by the name of the database. I cross my fingers and here we go. Oh, and you see that I got an error. This is actually quite common.

It's because when you start typing in these long commands, which have lots of options and even though there's only one option here, it's a very long option. It's easy to mistype something. When I hit the up arrow in UNIX for most systems it retypes what I just typed in, and I'll take a quick look through it and here I would normally go back and forth between what's typed there and the site itself and see, okay, site-install. Oh! I forgot this @localhost after the password. So let's give that a shot. I'll go back, dbpass@localhost, and now try it.

It warns me that I'm going to create a new site and create all of these files and drop tables in the database. Yes, we do want to continue. And I should mention I already set up that database. So yes. This takes a little while and everything works great. Now you'll notice that it came up with this default username of admin and a randomized password, let's see if that actually works. I'm going to copy this password from my Terminal window, go back to the site, and then simply reload drush.tomgeller. com and indeed there we are, it's a fully functional site installation from just that one command.

Now it gave me a default title here site-install and it had that admin as username and that password. Let's just make sure we can log in. It included a few other things by default, which we can see as we go to Configuration and then Site information. For example, admin@example. com is the e-mail address. It just picks it out of the air really. Now I'm going to go back and do exactly the same thing, but this time I'm going to include my own username and e-mail address and all of that other stuff.

One great thing about the site-install command is that you don't even have to delete the old database tables or settings.php file to make it work, Drush takes care of it for you. So normally I would come in and I would fiddle around a little bit, but let's just go ahead. Now this is going to be an extremely long command, and I'm not going to explain all the options. As you know you can take a look at the information on drush.org to get all the details. We're going to be starting with a clean slate, so I might as well clear the screen with Ctrl+L. Okay, here we go. Wish me luck.

Once again we get the warning, and the installation continues as before, only this time with the options that we specified. And there we go! Once again it tells us who the super user is, user1 and the user password. Let's give that a try. Go back up here; try user1 and user1 and user1pass. The first thing you notice even before we get in is we've changed the title as we wanted, but let's see if it's all worked as expected. Yup, there it is! If we go to user1, we see that it has the e-mail address that we asked for and so forth.

So you can see just how much power Drush gives you and we've only just gotten started. You will have to get used to the command-line interface, but the good news is that you won't have to memorize all those switches and options. Just keep the documentation open in a web browser in the background and switch back and forth as needed. That's basically what I do and in fact I have it right here as you saw earlier. Again, that documentation is found at drush.org. In the next video I'll do a few more Drush commands just to give a sense of how to build a site using Drush.

There are currently no FAQs about Drupal 7 Advanced Training.

Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.

Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

* Estimated file size

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.

Mark all as unwatched Cancel


You have completed Drupal 7 Advanced Training.

Return to your organization's learning portal to continue training, or close this page.

Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.