Installing drupal using FTP
There are many different way to install Drupal on a web server. In this tutorial, I'm going to show you how to install Drupal using FTP. The FTP method requires the least technical know-how, thus it's a good place to start if you're new to working with web servers. If you're comfortable working with servers from a command line, you might want to skip to the next tutorial: Installing Drupal with SSH and Drush.
Installing Drupal with SSH and Drush is the method the experts like to use. It saves you several steps, but if you're unfamiliar with Linux commands, it might be a little daunting. There are a few prerequisites we need to go over before we can start our install.
Prerequisites to Install
First, I'm going to assume you have access to web hosting that meets Drupal's requirements. In addition, we'll need to be able to create databases and have FTP or SFTP access to the server. The easiest way to get the proper hosting setup is to get an account with a commercial web host provider. For more information on the types of hosting available, see the tutorial: Installation Requirements and Options. If you're not ready to commit to a commercial host but still want to work through this tutorial, I recommend getting a trial account with Web Enabled at webenabled.com. Web Enabled will give you full FTP access to your trial account so you can follow along with the steps in this tutorial. You'll also need an FTP client. Here I recommend FileZilla. It's free and works on Windows, Mac, and Linux, and really is a pretty good FTP client. You can download and install it for free at filezilla-project.org or get the portable version in the webmaster tools kit. For more information about this, see the tutorial: Essential Webmasters Tools.
Set Up a Database
The first step in our installation is to set up a database for our Drupal stored data. Various web hosts will provide different ways of accomplishing this. The easiest way is to use a database manager such as phpMyAdmin or any of the alternatives provided by hosting control panels. Advanced users might want to use the command line or, if all else fails, you might just want to ask your host to set it up for you.
In this tutorial, we're going to look at the database manager method. In the tutorial Installing Drupal using SSH and Drush, we'll show you how to use the command line method. Let's take a look at how to create a database on a real web server. Here I have opened a very popular database manager called phpMyAdmin. This one is running on a web-enabled account, but many hosts provide this as a part of their hosting packages. It makes creating a database incredibly easy. We simply go to this field and type in the name of the database we want. There! We've created our tutorial database. There's nothing actually in this database yet. We can tell that because this number here represents the number of tables. There's zero so there's no data in it. That's going to be up to Drupal's installer to put the data in, but we have to give the installer a database to work with.
Let's take a look at another fairly popular way of creating database tables. This is something called a control panel. This one in particular is called cPanel, but there are several others out there like it. They're pretty popular with shared hosting providers as they allow users to manage their own websites. They give us all these tools so I'm going to scroll down to the mySQL tools. We have this mySQL Database Wizard. I'm going to go ahead and click on that, and here I type the name of my database. Now it's going to ask me for one more step and that's to create a user. What actually happens with databases is you have to create a database and a user. We didn't with our web-enabled account because it came with one for free. A lot of ones do that, but here we are going to have to create one so I'm just going to go ahead and put in admin and a password and create my user. I say what privileges I want to give that user to work with this database. I want to give it all privileges and now I'm done. I can return home and go to this controller and we see that I have a database and I have a user to work with it.
Upload Drupal Files to Server
The next step is we need to upload Drupal's files to our server. The first thing we need to do is to download them from Drupal.org. Once on the site, we click to Download & Extend, Download Drupal 7, and we want to select from these two archives. If you're on a Windows machine, I recommend using the zip. If you're on a Mac or a Linux machine, use the tar ball. So I'm going to go ahead and download the zip file here. I click Save and let it start downloading. Now that our archive is finished downloading, I want to uncompress the files and save them to my desktop. So just double click on this, close out a couple windows here, and drag this to my desktop so it uncompresses; this will take a few moments. Now I want to upload these files to our web server. To do that, I'm going to use our FTP client.
Go ahead and launch it and the first thing I want to do is I want to log into our server. So I'm going to go ahead and log into acmeexample and so now we see the file structure on our web server over in this window. I need to navigate to where the web files are going to go. This is actually a level below that where there is all kinds of administrative files. On most servers what you are looking for is something that's labeled publichtml or www. Both are actually aliased to the same place so I'll just click into here and now I can simply drag and drop these files in as I need to. And now it's starting to do our file upload. Now that our files have finished uploading, let's run back to our browser.
Let's see what our website looks like. So, we're going to go back to our main domain name and we see that we now have the Drupal installer. We've just got to run through these last few steps to get our site up and running. I've talked a little bit about what the next few pages of settings are in a previous video (Installing Drupal on a Personal Computer) so we're just going to accept the standard default and click Save and continue. We want to install in English, so again click Save and continue. Now suddenly this time we get an error page and it says that we have some problems with some files and some directories. I'll show you a little trick about what's going on here. You won't always get these errors on every host. It's going to depend on how your host is setup, but I'll show you how we can fix this problem.
I'm going to run back to my FTP program and we need to click into Sites > Default to see where the issue is. There's two things we need to do here. One is I want to create a new directory called files. Basically Drupal needs a place to store its user files. These are files that are uploaded by people that are doing content management and things along those lines. People are uploading through the browser and so we need to create that directory. The other thing is that it needs a writable file to store the database information. That's what this file is, but it wants to rename it so here's what I'm going to do real quick. I'm going to drag this back over here. I'm going to go ahead and rename this to Settings and that's the one it's going to actually work with, but it also wants this file. I need to have all these three sitting in here, then the last thing I need to do is to set the file permissions for this directory and for this file so that Drupal can write to them. So I'll check this, I'll select this, and go to File Permissions and I'm going to go to 777. Basically that means that the web server now can read and write and execute on these files. So I run back to my browser, click refresh, and our problems are all gone. Now we see a new page that we didn't see in our previous local installation. That's because now Drupal needs to connect to the database. So I'm going to go ahead and put in my database credentials here: AcmeExam and tutorial is the name that we gave our database and I need to put in the username and password. I'm going to click Save and continue. Now Drupal is writing all the files into the database.
Let's take a look at what that looks like. So go back to our control panel and we scroll down to phpMyAdmin and now we can click into our database and we see that we have all these tables in here and they are even populated with some data. So the Drupal installer did that for us. So we run back to our website and we notice that we have this warning that it wants us to change our permissions back on our Settings file. This is really a security issue so I just run back to my FTP, click File Permissions, and then I'm going to change this back to 644. Close that and now I can complete my installation. I'm going to go ahead and leave this site name for now. We can change that later using Drupal's admin.
In fact, all of these settings on this page we can change using the admin, but let's go ahead and put in some defaults to start out. Now I am going to put in the email address and we talked about this before, but this is a very important email address because this is what Drupal sends its notifications to. So I'm going to go ahead and put in an example email address. I'd recommend on your site, you want to put in something that you can actually receive emails from. I'm going to put in a username of admin and I'm going to put in a password.
On our local machine I put in a password of admin and that was a very low security password, but because this is a live web server I actually want to put in something that has some security to it. I also want to make sure my passwords match. I select what country I'm from and of course the last thing, we talked about this in a previous video, but these notifications here will automatically let you know whenever you need to do updates to your website, particularly whenever you develop security vulnerabilities so I'm going to leave those checked. We click Save and continue and now we've got a live Drupal website up and running. I click through and here's our Drupal website!
The FTP process for installing Drupal does have several steps, but I really don't think that they're too bad. In my experience, I found that 90% of the problems people have are server configuration issues mostly caused because different hosts have different server setups. Once you've done it a few times, I think you'll find that it becomes second nature.