If you want to give the new Craft CMS 5.0 Alpha without having to do any setup, this project is for you!
It allows you to spin up the Craft CMS 5.0 Alpha in your browser via Github Codespaces, or on your local computer with a few quick commands.
Whether in-browser or on your local computer, you'll have a fully functional Craft CMS instance with an editor, content, Twig templates, and a database.
This project was created using Spin Up Craft
- Click this button:
- In the resulting Terminal window, type
make dev
to start the project up - Wait until you see output like this, and then access the site via the credentials that are output on the console:
php_1 | ### Your Craft site is ready!
php_1 | Frontend URL: https://khalwat-laughing-space-zebra-xg9qxvqjpqhp5qx-8050.preview.app.github.dev/
php_1 | CP URL: https://khalwat-laughing-space-zebra-xg9qxvqjpqhp5qx-8050.preview.app.github.dev/admin
php_1 | CP User: admin
php_1 | CP Password: project
This lets anyone use the project without having to do any local setup.
You can use the Codespaces editor to edit Twig files, load the site frontend, or log into the Craft CP, all from within a browser!
The first time you start up your project in Codespaces, it'll take some time to set everything up. However, subsequent startups will be very quick.
You can access your existing Codespaces here:
Click on one to resume it. If you don't see a Terminal window, go to the hamburger menu in the top-left, and click on Terminal > New Terminal
You are limited to 15 active Codespaces on the free plan, but you can go in and delete any older Codespaces you're not using at any time.
- Have Docker Desktop installed
- Clone this repository down with
git clone https://github.com/khalwat/spin-up-craft-5.0-alpha.git
cd
to your repo in your terminal- Get the project up and running with
make dev
- Wait until you see output like this, and then access the site via the credentials that are output on the console:
spin-up-craft-50-alpha-php-1 | ### Your Craft site is ready!
spin-up-craft-50-alpha-php-1 | Frontend URL: http://localhost:8050/
spin-up-craft-50-alpha-php-1 | CP URL: http://localhost:8050/admin
spin-up-craft-50-alpha-php-1 | CP User: admin
spin-up-craft-50-alpha-php-1 | CP Password: project
Hit Control-C
to terminate the project and spin down the containers
The first time you start up your project, it'll take some time to set everything up. However, subsequent startups will be very quick.
This project uses make
to execute various commands in the appropriate containers. Here's a list of available commands:
make dev
- Start the dev servermake composer xxx
- Execute a composer command in the PHP containermake craft xxx
- Execute acraft
CLI command in the PHP containermake ssh
- Open up a shell in the PHP containermake db-admin-reset
- Reset the admin (user with theID=1
) to the defaults in from the.env
file; useful after importing a foreign databasemake db-export
- Clean thedb-seed/
directory and export the database to itmake db-import
- Import the db fromdb-seed/
directory into the mysql container
If the project is already running via make dev
you can use a second terminal tab/window to execute additional commands.
- The
.env
file is created by copyingexample.env
file when you start the project up - The server will use the
INITIAL_SERVER_PORT
in the.env
file for the initial port to start looking for unused ports from. It will increment it until it finds and unused port, and then use it - If instead you want to used a fixed port, you can explicitly set the
DEV_SERVER_PORT
in the.env
file - The Docker containers will be named after the project directory, so give it a unique name for each project
- Enjoy kicking Craft CMS 5.0 Alpha's tires!
Brought to you by nystudio107