You are currently viewing Installing and Configuring Directus

In the previous article, we have gone through some basics of headless cms and Directus. In this article, we will see how can we install and configure Directus Headless CMS on Windows Machine. I have followed the steps on the windows machine, but it will be similar for other operating systems as well.

Before we start the installation of Directus on the local machine we will need XAMPP and Directus source code. You can download them by clicking on the links below :

  1. XAMPP (Apache, MySQL, and PHP):
  2. Directus Source Code:

Installing XAMPP

To install XAMPP on your computer, go to the link above and download the XAMPP executable on your machine. Once downloaded, double click on it to start the installation.

While installing ensure you select PHP, My SQL and Apache. They are required to run Directus.

By default it will install in C drive, you can leave that, as is.

Just click Next and complete the setup. Once the setup is complete you will see XAMPP folder in you C Drirve.

To ensure XAMPP is installed correctly, let us start the apache server using XAMPP control panel.

Now, go to browser and type: http://localhost then it will show screen like below.

If you are able to see the page above, it means XAMPP is correctly installed. We are one more step behind setting up the Directus. We need a MySQL database and SQL User for installing and configuring Directus. So let us create one database and SQL User.

Creating MySQL Database and SQLUser

Follow the below steps to create MySQL database.

  • Open XAMPP and click on Admin in front of MySQL or navigate to http://localhost/phpmyadmin
  • Click on the Database tab.
  • Click on Create a Database and input field to enter the database name.
  • After entering the database name hit the Create button.
  • Remember this name we will be using this in Directus Setup. This database will contain all the data of our project.
  • You will see a success message on top of the green background.

Now the database is created, we need to create a SQL User so that we can connect to the database from the Dirctus application. Let us create one:

  • Open XAMPP and click on Admin in front of MySQL or navigate to http://localhost/phpmyadmin
  • Click on the User Account or Privileges tab on the top.
  • Under New section click on Add user account.
  • Supply User Name, Password, confirm your password in Re type
  • Check Grant all privileges on wildcard name (username\_%)
  • Click on Check all under Global privileges.
  • Click on the Go button at the bottom right.

This will create the SQL user we can use during setup Directus. Store the database name, SQL user name and password at safe place.

Installing and Setting up Directus

Follow the link to download the latest version of Directus. The code will be available as zip. Once downloaded unzip the folder. Now navigate to Dirctus folder and copy all the files. Come to XAMPP folder and navigate to htdocs. Create a folder (this will be your instance name) and paste all the files over there. For the sake of this tutorial, we will create a folder named mybrand.

Once all the files are copied on the mybrand folder. Open a browser and go to http://localhost/mybrand/public. Since we are setting it up for the first time, it will open a setup screen for us. The Setup is a 5 step process.

In the first step, it will ask you to keep your database details handy, we will need them in future steps.

In the second step, It will check for pre-requisite. I have one orange, which is warning, we can ignore. You may get all green at your end.

In third step, we have to enter our project information and login credentials. We will use this credential to login to the CMS, remember the login credentials you are entering here.

In the fourth step, we have to enter database details. In host you can enter localhost or, leave the port as 3306. Enter other details of the database we have created in the previous steps.

In the fifth step, you will get success message. You are all set now. Save the super admin password at a safe place, you will need that in the future.

Now click on Sign In, It will take you to the login page. Enter the login credentials we have supplied in the third step of setting up Directus.

Congratulation! you now have Directus running on your machine. In the next article we will see how to use Directus and create our own collections.

That’s it Folks on this topic. Let us know your comments on this article in the comment box below. Kindly like our facebook page, follows us on twitter and subscribe to our YouTube channel for latest updates.

Ravi Ranjan

Ravi Ranjan is Business savvy and Technically sophisticated professional with experience of more than 14 Years, reflecting strong leadership qualifications, primarily in Project management and Business Analysis. Currently spearheading as Project Manager and handling Techno Functional role in an IT Firm in Mumbai.

Leave a Reply