Step-by-step tutorial for installing & setting up a Drupal website

This is a step-by-step tutorial on setting up a basic, fresh Drupal installation, based on a custom design theme that you have created. This is intended for newbies and designers, and includes some tips that you need to know if you haven't worked with Drupal before.  I'm also included the recommended basic modules for any Drupal site.  

Here we go...

  1. On your web server, if you have access to your php.ini, increase your PHP Memory Limit to at least 36MB (or ask your web host to do this for you)
    1. I actually go as high as 96MB, to be safe.  The reason you want to do this, is because Drupal is very demanding of memory, and if you don't have enough allocated, your site will crap out, or you'll get the WSOD (white screen of death, eek)
       
  2. Set up a new database
    1. Depending on your host, you'll have access to do this thru a control panel, or directly in PHPmyadmin
    2. Either way you need to:
      1. Create a new database and give it a name
      2. Database collation should be "utf8_general_ci"
      3. Add/create a user for this database
      4. Add/associate the user with the new database
         
  3. Download Drupal to the directory you want to work in locally (or save it locally).
    1. As of this post date, I recommend you go with Drupal 6. Most modules still don't have a version for 7 quite yet.
       
  4. Unzip the Drupal download and rename the folder for your working directory
    1. IMPORTANT:  It's best to rename this folder, than copy the contents, as you may miss the hidden files if you try to select them all and copy/paste
       
  5. In your new directory, go to /sites/all
    1. Add the following new directories/folders:
      1. "modules"
        1. add this at /sites/all/modules
        2. This folder will contain all your modules; any modules NOT included in core installation. Very important to put all your modules in this folder, and NOT in the core modules directory at /modules.
      2. "themes"
        1. add this at /sites/all/themes
        2. This folder will contain all your custom themes, and any themes not included in the core installation
           
  6. Go to /sites/default
    1. Make a copy of "default.settings.php" and rename it "settings.php"
    2. Open settings.php, go to line 92 and add your database settings
      • I use this format:  $db_url = 'mysqli://dbuser:password@localhost/databasename';"
         
  7. In a browser, go to your new directory:  http://yourdrupaldirectory.com/install.php or http://localhost/install.php
     
  8. Follow the wizard to set up Drupal, entering your database information
    1. If you get errors check the following:
      1. Make sure you named your settings file "settings.php", and didn't just edit the default.settings.php
      2. Double check your database username & password in settings.php
      3. Double check your database name in settings.php
      4. Try some of the other suggestions in settings.php for formatting your database connection information
    2. For the Administrator Account (also known as "first user"), always enter "admin" as the username
      • Save this information in a safe place, as only the Admin user can do certain things, and you'll often need to login as Admin.
    3. Be sure "Clean URLs" are enabled
    4. Set your time zone
    5. Click "Save & Continue" to complete installation
       
  9. Click the link to visit your new site. The first thing we should do is add the handy "Administration Menu" module. This will make is much easier to navigate around the site as we set things up.
    1. Download the Administration Menu module and save it to your /sites/all/modules directory
    2. Install the module (here are steps for installing ANY Drupal module)
      1. Unzip the module and upload it to your server
      2. Go to Administer > Site Building > Modules (/admin/build/modules)
      3. Check the "Administration Menu" module
      4. Click "Save"
         
  10. The next thing we'll do is add User Roles & User Accounts
    1. Using your handy Admin Menu at the top, go to:  User Management > Roles (/admin/user/roles)
    2. Add the following roles:
      1. Administrator:  This will be site managers who have FULL access to everything
      2. Editor:  This role will be restricted and for clients or users editing content only
    3. Add accounts
      1. Go to User Management > Users > Add User
      2. To start add just add an administrator account for yourself, but once the site is ready you'll want to add accounts for the rest of users in your organization
         
  11. Basic Modules
    1. Go to Site Building > Modules (admin/build/modules), and you'll see the optional Drupal Core modules.  I personally like to have the following enabled, and disable all other Core modules.
      1. Color
      2. Comment
      3. Database logging
      4. Menu
      5. Path
      6. PHP filter
      7. Search (if a simple search for a small site is needed)
      8. Statistics
      9. Taxonomy
      10. Trigger
      11. Update Status
         
    2. Next is the fun part of selecting non-core modules for your site.
      1. Check out my post on The Basic Must-Have Modules for Any Drupal Website. I highly recommend installing these modules to get you started, as all can be beneficial for pretty much any Drupal site.
      2. Outside of these, you'll need to identify the functionality and features you want on your site, then look for the appropriate module.
         
  12. Now we need to create a custom theme for your custom design.
    1. Always start with Zen and create a Zen sub-theme
      1. I'll follow up with a post for how to build a Zen sub-theme.   In the meantime you can download Zen, and check out the README for very good step-by-step instructions.
         
  13. Some next steps (I won't go into a how-to here, but this is helpful to know):
    1. Set up your navigation, using the "Primary Links" menu for your main nav
    2. Set up additional content types using CCK for complex content or content template
    3. Set up your taxonomy for your content types if needed
    4. Set up a search solution
    5. Implement complex functionality needed. There is likely a module for anything you can think of, one of the powers of an active Drupal community.

At this point you should have a bare bones working site in Drupal, which gives you a great starting point to build upon.  

Some helpful tips to keep in mind:

  • Be sure to use pathauto for SEO friendly url's
  • When setting up links to pages, link to the node ID, rather than the friendly url. This will give you flexibility to change the title without breaking any links
  • If setting up forms, use the Mollom module for spam protection
  • Avoid hard-coding anything at all, instead work with Drupal's built in system. This will avoid anything breaking in the future.

Will stop this tutorial here, and add some future posts around site building and features.  

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
By submitting this form, you accept the Mollom privacy policy.

Call the giant. Email the giant. Text us. Flag us down on the sidewalks of Seattle.

Marie will meet with you and kickstart you into the realm of gigantic creative possibilities.

Contact Marie directly by email or call 206-724-7724.