How to install Craft CMS using Composer & XAMPP Windows 11


Craft CMS is yet another free and user-friendly content management system that you can use to create a website. You can try this CMS for free when you download its Solo Version. Other versions are Pro which cost $299 and Enterprise. For this tutorial, we are going to make (of course) a free website out of its free or Solo version. But before anything else, please download the XAMPP and Composer files below. We will be needing these applications later.


Requirements:



Assuming that you already downloaded the files above, continue doing the tutorials below.


Table of Contents


  • Installing XAMPP
  • Running XAMPP Control Panel
  • Installing Composer
  • Making a Craft CMS database on phpMyAdmin
  • Installing Craft CMS website using Composer via Powershell
  • Opening Craft CMS website homepage
  • Opening Craft site admin account

Here are the steps on how to install Craft CMS using Composer and XAMPP in your Windows pc


Installing XAMPP


1. Again, go to the XAMPP file that you downloaded. Open it. If a Question about "antivirus running" appears, click on Yes to proceed.


xampp installation warning about antivirus

2. If a Warning also appears about User Account Control (UAC), just leave it and press OK to proceed.


xampp installation warning about user account control windows

3. Under Setup - XAMPP, just press NEXT.


welcome to xampp setup wizard witn next button

4. In the Select Components, just leave it as it is and press NEXT again.


xampp installation select components

5. Under Installation folder, do not change it. Just press NEXT to continue.


xampp installation select a folder to install xampp

6. Under Language, select English. Press NEXT to proceed.


select language for xampp installation

7. We are now ready to install XAMPP, click on NEXT to start.


xampp installation ready to begin

8. Wait for the installation to finish.


xampp installation in progress unpacking files

9. When done, click on Finish to exit the installer.


xampp installation finished

Running XAMPP Control Panel


1. To run XAMPP, you can click its shortcut located in your desktop or go to Start and search for "xampp" and press ENTER.


search for xampp app windows

2. Inside XAMPP Control Panel, click the Start buttons for Apache and MySQL.


start xampp apache mysql server

3. You will see two Stop buttons now, meaning, Apache and MySQL are both running.


xampp apache mysql server are running

4. If a "Windows Security Alert" appears, just click on Allow access to exit the alert.


allow access to xampp in windows defender firewall

Installing Composer


1. Open the Composer executable file that you downloaded earlier. In the "Select Setup Install Mode" click on "Install for all users (recommended)" to proceed.


select install mode for composer

2. Under Installation Options, just press NEXT.


intallation options for composer

3. In the Settings Check do the following. For the "Choose the command-line PHP you want to use" just press on Browse and go to This PC > c drive > xampp > php > and click on php.exe to select it. When done, check the "Add this PHP to your path?" option. Press NEXT to continue.


composer installation settings check for php

4. In the Proxy Settings, just leave it and press NEXT.


composer proxy settings

5. We are now ready to install Composer. Click on Install to start.


composer is ready to be installed

6. Wait for the installation to finish.


downloading and running composer installer script

7. Under Information, just leave it and press NEXT.


composer setup information

8. Click on Finish to exit the installer. Your Composer is now installed on your pc.


successfully installed composer

Creating a Craft CMS database on phpMyAdmin


1. We are now going to create a Craft CMS database. Open your web browser and type 127.0.0.1 and then press ENTER.


accessing xampp localhost using chrome

2. Inside, click on phpMyAdmin to proceed.


accessing xampp phpmyadmin

3. Now inside phpMyAdmin, click Databases.


phpmyadmin creating database for craft cms

4. In the Create database, name your database as "craft_db" for this tutorial. Character set, choose utf8mb4_unicode_ci. Press Create to confirm.


naming and creating craft cms database localhost

5. In Create new table, name your table as craft_table. By default column is set to 4. Just leave it and press Create to proceed.


naming and creating craft cms database table localhost

6. For structure, name it as craft and next to it Type should be set to INT.


structure name craft cms database localhost

7. For Collation, select utf8_unicode_ci and leave all the other fields blank.


structure collation craft cms database localhost

8. Save your database.


save craft cms database structure localhost

Installing Craft CMS website using Composer via Powershell


1. We are now ready to install our Craft CMS website. Open your Windows Powershell.


search for powershell on windows start

2. Inside Powershell, type composer create-project craftcms/craft "C:\xampp\htdocs\craft" and press ENTER.


composer create project craft

3. You will then see the image below, after pressing ENTER. Composer is now creating the "craftcms/craft" project at the selected location. If Questions are asked, just type "y" and press ENTER to proceed.


composer is creating craft project

4. When done, you will see a "Craft CMS - a new install" graphics and "Welcome to Craft CMS!" messages.


successfully created craft project using composer

5. Now, we need to change directory. Type cd "c:\xampp\htdocs\craft" and press ENTER to change your current directory to your craft folder directory.


change directory craft folder xampp htdocs using powershell

6. As you can on the image below, from "C:\Users\zemira" my current directory is now at "C:\xampp\htdocs\craft".


run php craft setup using powershell

7. Now, type php craft setup and press ENTER.


successfully changed to craft project directory using powershell

8. Do the following for the next step.


  • Which database driver are you using? (mysql or pgsql) [mysql] - just press ENTER
  • Database server name or IP address: [127.0.0.1] - just press ENTER
  • Database port: [3306] - press ENTER
  • Database username: [root] - press ENTER
  • Database password: - leave it blank and press ENTER
  • Database name: type craft_db and press ENTER
  • Database table prefix: leave it blank and press ENTER
  • Install Craft now? (yes|no) [yes]: press ENTER
  • Username: [admin] - press ENTER
  • Email: type a valid email address and press ENTER
  • Password: type your admin password (do not forget it) and press ENTER
  • Confirm: re-type your password and press ENTER
  • Site name: name your website and press ENTER
  • Site URL: type http://localhost/craft and press ENTER
  • Site language: [en-US] - just press ENTER.

craft database site admin settings

9. After installation, you will a message saying "***installed Craft successfully (time: 5.543s)".


successfully installed craft using powershell

Opening Craft CMS website homepage


1. To open your Craft website homepage, open your web browser and go to 127.0.0.1/craft/web or localhost/craft/web.


craft website sample homepage

Opening Craft site admin account


1. To open your website admin page, just go to 127.0.0.1/craft/web/admin/login.


craft website admin login page

2. Enter your username which is admin and your password. Press Sign in to proceed.


login craft website admin username and password

3. Inside your administration page, you will see there your Dashboard, Utilities, Settings, and Plugin Store. This is only accessible and available to you as admin and owner of your Craft website.


sample administration page craft website

Thank you for reading this tutorial. I do hope that you have learned a lot while doing this. If you have a question, just leave a comment below. Cheers!

No comments:

123how.xyz only wants on-topic comment. Do not include any link, else your comment won't be published. Thanks!

Most Read Tutorials:

Powered by Blogger.