# Kirby local development with DDEV

**URL:** <https://forum.getkirby.com/t/kirby-local-development-with-ddev/29895>\
**Category:** Questions\
**Tags:** v3\
**Created:** [November 3, 2023, 9:19pm UTC](https://forum.getkirby.com/t/kirby-local-development-with-ddev/29895 "2023-11-03T21:19:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![eheiser](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/eheiser/32/432_2.png) [@eheiser](https://forum.getkirby.com/u/eheiser)\
**Post date:** [November 3, 2023, 9:19pm UTC](https://forum.getkirby.com/t/kirby-local-development-with-ddev/29895/1 "2023-11-03T21:19:11Z")

</div>

DDEV is not listed here [https://getkirby.com/docs/cookbook/setup/development-environment](https://getkirby.com/docs/cookbook/setup/development-environment)  
Anyone have a guide/tutorial for setting it up with DDEV?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 5, 2023, 2:05pm UTC](https://forum.getkirby.com/t/kirby-local-development-with-ddev/29895/2 "2023-11-05T14:05:47Z")

</div>

Just follow their [instructions](https://ddev.com/get-started/), and you should be good to go. I did a quick test, and it worked, although it creates a DB container not needed for Kirby, so waste of resources, but I guess you can configure that.

Instead of using DDEV, you can set up your own docker containers: [Kirby meets Docker | Kirby CMS](https://getkirby.com/docs/cookbook/setup/kirby-meets-docker)

---

<div class="post-metadata">

**Author:** ![wsydney76](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/wsydney76/32/13964_2.png) [@wsydney76](https://forum.getkirby.com/u/wsydney76)\
**Post date:** [November 10, 2023, 9:55am UTC](https://forum.getkirby.com/t/kirby-local-development-with-ddev/29895/3 "2023-11-10T09:55:01Z")

</div>

Yes, as DDEV is becoming more and more popular, it would be great to have it mentioned in the docs. Quite simple, but a bit specific.

We have used DDEV for Kirby development recently, I can share the notes we took:

Once DDEV is installed and running:

- Create a project directory and cd into it
- Run `ddev config --php-version=8.2 --omit-containers=db`

Via download:

- Extract the contents of the ZIP file into your project directory
- Run `ddev start`

Via composer:

- Run `ddev start`
- Run `ddev composer create getkirby/starterkit`. Do **NOT** run composer create-project on your local machine!

You can now access the site via `https://<foldername>.ddev.site` .

When you access the panel for the first time via `/panel`, you will probably see an error message:

![image](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/b/b7b1bc7ee2669dadc3b70af6bd20cfd9cf64c66b.png)

You can fix that by adding this line `'panel.install' => true` to `site/config/config.php`

PS:  
Saw a FR about that in [https://kirby.nolt.io/410](https://kirby.nolt.io/410). Looks like that the client IP will finally not be 127.0.0.1 when a request is passed through the DDEV router.

---

<div class="post-metadata">

**Author:** ![eheiser](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/eheiser/32/432_2.png) [@eheiser](https://forum.getkirby.com/u/eheiser)\
**Post date:** [November 10, 2023, 11:05am UTC](https://forum.getkirby.com/t/kirby-local-development-with-ddev/29895/4 "2023-11-10T11:05:49Z")

</div>

I already had ddev & docker desktop installed for craft cms development. Getting Kirby up and running was very straightforward.  
I was unaware of the `--omit-containers=db` flag, that’s a good one to remember for the next one, thanks!

---

<div class="post-metadata">

**Author:** ![wsydney76](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/wsydney76/32/13964_2.png) [@wsydney76](https://forum.getkirby.com/u/wsydney76)\
**Post date:** [November 10, 2023, 11:31am UTC](https://forum.getkirby.com/t/kirby-local-development-with-ddev/29895/5 "2023-11-10T11:31:21Z")

</div>

Forgot to mention the [CMS Quickstarts](https://ddev.readthedocs.io/en/stable/users/quickstart/) page from the DDEV docs. I believe they are very open to add other systems like Kirby to that page. Could also have a certain marketing effect…

---

<div class="post-metadata">

**Author:** ![wsydney76](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/wsydney76/32/13964_2.png) [@wsydney76](https://forum.getkirby.com/u/wsydney76)\
**Post date:** [November 14, 2023, 1:15pm UTC](https://forum.getkirby.com/t/kirby-local-development-with-ddev/29895/6 "2023-11-14T13:15:49Z")

</div>

Got a couple of additional questions about DDEV setup for Kirby:

### Does it have any implications that DDEV uses the nginx web server by default?

See [Running Kirby on a Nginx web server](https://getkirby.com/docs/cookbook/setup/nginx)

DDEV ships with a default nginx config file which should be fine for most cases. However, it does not protect the content|site|kirby folders.

You can:

**1. Don’t care**

This is only your local dev setup, which is (hopefully) not used in production.

**2. Update the nginx config file**

Edit `.ddev/nginx_full/nginx-site.conf`

Delete this line:  
`#ddev-generated`

Add this line:  
`rewrite ^\/(content|site|kirby)/(.*)$ /error last;`

Run `ddev restart`

**3. Use a public folder setup (recommended anyway)**

Run `ddev config --docroot=public --create-docroot && ddev restart`

Move all your assets into the public folder.

Create an `index.php` file in the public folder with [this content](https://getkirby.com/docs/guide/configuration#custom-folder-setup__public-folder-setup).

**4. Switch back to Apache…**

Run `ddev config --webserver-type=apache-fpm && ddev restart`

### How to access the site from local network?

By default, the myproject.ddev.site domain is only accessible from your local computer. Couple of options [here](https://ddev.readthedocs.io/en/stable/users/topics/sharing/), we used this one:

Run `ddev config --host-webserver-port=57001 --bind-all-interfaces && ddev restart`, where you can use any free port.

Update `site/config/config.php` according to [docs](https://getkirby.com/docs/reference/system/options/url).

Adding `'url' => '/'` worked for us.

You can now access the site via `http://<ip>:57001` from anywhere in your local network.

---

<div class="post-metadata">

**Author:** ![schnarr.tech](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@schnarr.tech](https://forum.getkirby.com/u/schnarr.tech)\
**Post date:** [February 14, 2024, 10:45am UTC](https://forum.getkirby.com/t/kirby-local-development-with-ddev/29895/7 "2024-02-14T10:45:01Z")

</div>

Hey peps!  
Thanks for this helpful thread!

Are there any folks here, that have used DDEV for [Multisite Setup](https://getkirby.com/docs/cookbook/setup/multisite) yet?  
If so, how did you do it?

It seems a bit over-engineered and not very smart to create one ddev setup per site folder. That would create so many more containers.

Always changing the `docroot` in DDEV’s `config.yml` and then restarting is also not really an option…

Would be cool if someone else has got some ideas about that 🙂

---

<div class="post-metadata">

**Author:** ![eheiser](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/eheiser/32/432_2.png) [@eheiser](https://forum.getkirby.com/u/eheiser)\
**Post date:** [February 14, 2024, 11:17am UTC](https://forum.getkirby.com/t/kirby-local-development-with-ddev/29895/8 "2024-02-14T11:17:58Z")

</div>

I could be wrong, but maybe have a look at the ‘additional project hostnames’ setting?

> **[Additional Project Hostnames - DDEV Docs](https://ddev.readthedocs.io/en/latest/users/extend/additional-hostnames/)**
>
> Do local website development on your computer or in the cloud with DDEV.

(at least that’s what I use for multisite craftcms sites for local development)  
There’s also a very active community on discord if you need ddev help ([Support - DDEV Docs](https://ddev.readthedocs.io/en/latest/users/support/))

---

<div class="post-metadata">

**Author:** ![schnarr.tech](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@schnarr.tech](https://forum.getkirby.com/u/schnarr.tech)\
**Post date:** [February 14, 2024, 3:04pm UTC](https://forum.getkirby.com/t/kirby-local-development-with-ddev/29895/9 "2024-02-14T15:04:10Z")

</div>

Thank you for your help on that,  
just setting the additional hostnames option won’t be enough, that just creates another domain essentially.

But after quite some research I found out, there is a file in the `.ddev/apache` or `.ddev/nginx_full` folder called `seconddocroot.conf.example`. You can clone this and follow the instructions in the Readme inside that folder, that way, you can setup another domain with a separate docroot, pointing to the individual entrypoint for one of the sites.

It’s also important to add these new domains under `additional_hostnames` or `additional_fqdns` in your `config.yml`, otherwise the ssl won’t work.

At least that’s how it works for me now! 🙂
