In this quick tip, we’ll be installing a local instance of Drupal 8, beta 1. By the end, you’ll have a copy of Drupal that’s not only ready to be extended with Symfony bundles and other packages, but also ready to accept content and display it to end users.
Step 1: Prepare Environment
In order for everyone to have the same starting point, we’ll be using our trusty old Homestead Improved vagrant box. It’s important to note that even if this tip will be installing Drupal 8 into the Vagrant box, the procedure is absolutely identical for any Ubuntu based environment.
So, somewhat optional, please clone a new Homestead Improved instance as per instructions in this tip. Then, add a new site and make sure you add the entry to your host machine’s hosts file. In my case, it’s
Homestead.yaml looks like this:
--- ip: "192.168.10.10" memory: 2048 cpus: 1 folders: - map: . to: /home/vagrant/Code sites: - map: homestead.app to: /home/vagrant/Code/Laravel/public - map: test.app to: /home/vagrant/Code/drupal variables: - key: APP_ENV value: local
Step 2: Download and extract Drupal 8 b1
If you’re using a VM, log into it and enter the folder where you keep your projects. In the case of the Homestead Improved installation above, that’ll be
/home/vagrant/Code. If you’re using your own LAMP stack or whatever, just go into your projects folder.
When downloading finishes, extract the archive and rename the resulting folder to
tar -xvzf drupal-8.0.0-beta1.tar.gz mv drupal-8.0.0-beta1 drupal
Step 3: Create the DB
In this case we’ll be using MySQL. We’ll also be using Homestead-specific user/pass defaults. If you’ve got your own environment, adapt as needed. For PostgreSQL see here.
mysqladmin -u homestead -psecret create drupaltest mysql -u homestead -psecret
Once in the MySQL console, execute the following:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON drupaltest.* TO 'homestead'@'localhost' IDENTIFIED BY 'secret'; exit
Step 4: Settings
In this step, we create a settings and services file from the provided templates, and let the Drupal installer edit them by altering permissions.
cd drupal cp sites/default/default.settings.php sites/default/settings.php cp sites/default/default.services.yml sites/default/services.yml chmod a+w sites/default/settings.php chmod a+w sites/default/services.yml chmod a+w sites/default
Step 5: Install
In your host’s browser, enter the URL
test.app:8000/install.php and follow the instructions of the wizard.
Choose a standard installation profile for the quickest setup. You can find out more about these profiles here, if interested.
Optional Cleanup and Tweaks
Optional but recommended:
- Remove the original downloaded archive to free up disk space
- Activate the cron
Change the permissions back:
chmod 644 sites/default/settings.php
chmod 644 sites/default/services.yml
chmod 755 sites/default
As you can see, adding a new Drupal installation onto your server can be done in minutes from total zero to fully functional CMS. For more information on other aspects and edge cases of Drupal installation, see their installation guide.
Jump Start Git, 2nd Edition
Visual Studio Code: End-to-End Editing and Debugging Tools for Web Developers