Choosing a local dev environment
The easiest way to start testing and developing with Kirby is in a local development environment: you can easily edit your files locally, immediately see changes in the browser, and deploy your site on a public server when you are ready.
Kirby has only very few server requirements, and you have therefore many options when choosing the development environment that is right for you–no matter if you want to develop on a Mac, Windows or Linux.
DDEV
DDEV is an increasingly popular Docker-based development environment, that's quickly easy set up on Mac, Linux and Windows. It doesn't require any Docker knowledge unless you have special requirements.
Check out our Kirby meets DDEV cookbook recipe
XAMPP
XAMPP is similar to MAMP, free, and available for Mac, Windows and Linux.
In a default installation, the web root folder is located under programs/XAMPP/htdocs
on a Mac or C:\XAMPP\htdocs
on Windows. XAMPP is probably the most popular GUI tool used on Windows/Linux.
Vagrant + Virtual Box
Vagrant is a command line tool for building and managing virtual machine environments in a single workflow. It supports VirtualBox, a free, cross-platform virtualization solution, but also works with other virtualization products.
It provides a virtual development environment where you don't have to install a server, PHP, database or other development tools on your local computer. The advantage of this solution is that you can install a box that resembles your deployment environment as closely as possible.
Follow their Getting Started guide to get up and running.
Laravel Homestead
Laravel Homestead is an official, pre-packaged Vagrant box and provides a full-featured virtual development environment, that doesn't require you to install PHP, a web server, or any other server software on your computer.
PHP's built-in server
If a recent PHP version that supports Kirby is already installed on your system and you are fine using the command line, you can spin up PHP's built-in server from the command line, specifying the kirby/router.php
file to use Kirby's router.
You should now be able to reach your local server at http://localhost:8000.
While using the built-in server works fine for many use cases, you might sometimes run into issues. We therefore don't really recommend this environment.
Laravel Herd
Laravel Herd is a one click PHP development environment with zero dependencies, running out of the box without any hassles. According to its self description it is the fastest environment around.
Sites can be configured via a GUI or command line just like Laravel valet. Different PHP versions can be used for all your sites and sharing of local sites is also possible via Expose.
One minute install with Laravel Herd
MAMP or MAMP Pro
MAMP (free) and MAMP Pro (paid) are available for both Mac and Windows. They are a good solution if you prefer a GUI interface. Both MAMP and MAMP Pro come with Apache, up-to-date versions of PHP and all the modules you need for Kirby already installed.
MAMP Pro allows you to create a host for each project, use Nginx instead of Apache, and some other useful features.
Once MAMP is installed, the default folder to put your Kirby folder into is the programs/MAMP/htdocs
folder (Mac) or the C:\MAMP\htdocs
folder (Windows). By default, you can then access the project under http://localhost:8888/project-folder-name
.
Laravel Valet
Laravel Valet is a minimalist development environment for Mac. It requires you to install PHP directly onto your local machine. Valet supports Kirby out of the box. Check it out if you want a fast development environment for Kirby and are not afraid of the command line.
Once Valet is installed, you're ready to start serving sites using the park
or link
commands.
The beauty of Valet is that is detects every folder you put into your parked sites folder, which is then automatically deployed to http://project-name.test
without you having to set up hosts manually. It also supports https
out of the box.
There's also a Windows fork of Laravel Valet and also some tutorials on the web. Since we are not on Windows, we can't tell if that works with Kirby out of the box or if you need a custom driver.
Valet+
Valet+ is a third-party fork of Laravel Valet. The principle is the same as outlined above, but as its name suggest, Valet+ comes with some additional features like PHP version switching or Xdebug on/off mode, which you can check out in the documentation.