This page provides a summary of the command line instructions for installing Drupal on a typical UNIX/Linux web server. Every step contains a link to more detailed installation instructions where you also can find information about installing Drupal on other systems.
If you have problems, read Troubleshooting common problems.
Read more about system requirements (among which detailed PHP-settings and browser requirements).
Download and extract files
Download Drupal from http://drupal.org/project/drupal and extract the download file to a folder on your hard drive. (Replace the 'xx' in drupal-x.x.tar.gz with the actual version you've downloaded.)
wget https://www.drupal.org/files/projects/drupal-x.x.tar.gz tar -zxvf drupal-x.x.tar.gz
Move the files to a directory within your web server's document root or your public HTML directory using the following command, substituting drupal-x.x with the actual version number. (On many *nix computers the path from the server's root will be
mv drupal-x.x /var/www/
You can install and use Drupal in other languages by downloading translations from http://localize.drupal.org/. Extract the files into your installation profile's translations directory. For instance, if you are using the Standard install profile, move the .po file into the directory: profiles/standard/translations/. Note for Drupal 6: This method is currently not working, please see http://drupal.org/node/882164#comment-3486284 for more information.
Read more about downloading and extracting Drupal (includes instructions for other operating systems).
Create the configuration file and grant permissions
In the sites/default directory, copy the default.settings.php file and rename the copied file to settings.php.
cp sites/default/default.settings.php sites/default/settings.php
Give the web server write privileges (
u=rw,g=rw,o=rw) to the configuration file.
chmod a+w sites/default/settings.php
Give the web server write privileges to the sites/default directory.
chmod a+w sites/default
Read more about settings.php and the files directory.
Create the Drupal database
To complete the installation, you must create an empty database and a user with full access to the newly created database for Drupal to use. You can do this by command line, or through phpMyAdmin or another database client.
mysqladmin -u username -p create databasename
Where 'username' is a MySQL user which has the CREATE and GRANT privileges. MySQL will prompt for the 'username' database password. Next you must set the access database rights. Log in to MySQL:
mysql -u username -p
At the MySQL prompt, enter:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON databasename.* TO 'username'@'localhost' IDENTIFIED BY 'password';
'databasename' is the name of your database
'username' is the username of your MySQL account
'localhost' is the server name used to access MySQL
'password' is the password required for that username
If successful, MySQL will reply with:
Query OK, 0 rows affected
Read more about creating the database (including instructions on using a browser-based control panel, phpMyAdmin, command line, MySQL, or PostgreSQL to create your database).
Run the installation script
You are now ready to run the installation script. Point your browser to the base URL of your website (e.g.
The installation wizard will guide you through several screens to set up the database, add the first user account, and provide basic website settings. Follow the wizard to finalize the installation and start working with your Drupal website.
Quick installation with Drush
The fastest way to install a site is by using Drush. You can skip most of the other steps above too. Start with only the base of Drupal, which you can also get with Drush...
drush dl drupal --drupal-project-rename=example cd example drush site-install standard --db-url='mysql://[db_user]:[db_pass]@localhost/[db_name]' --site-name=Example
It will create the database for you if the db_user above has the privileges to.
By default the UID 1 account is given an "admin" username and a random generated password that gets echoed in terminal during the site installation process. You can bypass this and set your own predefined credentials with flags added to the command:
In case you don't get any password echoed in terminal (might be the case of an earlier drush version) try using admin as username and password.
The installation profile used can be left out, it defaults to standard, or set to something else. Use
drush help si to see more flags available for the site-install command.
Resetting your Drupal build with drush site-install
In some cases, you might want to dump your data and rebuild the site from scratch. One example: if building a site based on Features modules, resetting the site would let you test your Features correctly.
To reset, i.e. delete a site's content and set up a "minimal" build, use the following. You can omit database connection strings if they are already hardcoded in settings.php .
$ drush site-install minimal --site-name=MYSITE You are about to DROP all tables in your 'MYSITE' database. Do you want to continue? (y/n): y Starting Drupal installation. This takes a while. Consider using the --notify global option. Installation complete. User name: admin User password: [shows random password generated]