How to Install Directus on Windows 11
Directus is an open-source headless CMS that allows developers to manage and customize their content APIs. In this tutorial, we will show you how to install Directus on Windows 11.
Prerequisites
- Windows 11 installed on your machine
- A local server environment with PHP and MySQL installed
- Composer installed on your machine
- Git installed on your machine
Step 1: Download Directus
Open your browser and go to https://directus.io/. Click on the Download button on the homepage and choose the latest stable release. Once the download is complete, extract the ZIP file to your local server environment.
Step 2: Configure the Database
Open your MySQL client and create a new database for Directus. Note down the database name, MySQL username, and password as we will need them later.
Step 3: Configure Environment Variables
Go to the root directory of Directus and create a new file named .env. Copy the contents of .env.example and paste them into the new file. Fill in the details of your MySQL database as follows:
DATABASE_HOSTNAME=127.0.0.1
DATABASE_NAME=directus
DATABASE_USERNAME=username
DATABASE_PASSWORD=password
Replace username and password with your MySQL login credentials and save the file.
Step 4: Install Dependencies
Open your command prompt or terminal and navigate to the Directus root directory. Run the following command to install dependencies:
composer install
Step 5: Run the Directus Setup Wizard
After the dependencies are installed, run the following command to start the setup wizard:
php artisan directus:install
Follow the prompts in the console to set up Directus. When prompted for the database credentials, enter the details you saved in the .env file in Step 3.
Step 6: Start the Directus Server
After the setup wizard is complete, start the Directus server using the following command:
php artisan serve
You should see a message in the console that Directus is running on http://127.0.0.1:8000. Open your browser and go to the URL to confirm that the installation was successful.
Conclusion
Congratulations! You have successfully installed Directus on Windows 11. With Directus, you can now manage and customize your content APIs easily.