<p>As of today the <a href="https://craftcms.com/knowledge-base/migrating-from-craft-nitro-to-ddev" rel="nofollow noreferrer">Craft docs</a> note deprecating <a href="https://github.com/craftcms/nitro" rel="nofollow noreferrer">Nitro</a> in favor of <a href="https://ddev.com/" rel="nofollow noreferrer">DDEV</a> or similar projects.</p>
<p>There is also some good content on <a href="https://craftquest.io/courses/ddev-and-craft-cms-quick-start-guide/43386" rel="nofollow noreferrer">Craft Quest about using DDEV</a>.</p>

CC BY-SA 4.0
2021-01-12T17:58:00.910Z
2022-08-24T14:39:44.553Z
2022-08-24T14:39:44.553Z
Bill Columbia
<p>I am creating an image to help me test Craft. </p>

<p><a href="https://github.com/gabrielmoreira/docker-craft" rel="nofollow">https://github.com/gabrielmoreira/docker-craft</a></p>

CC BY-SA 3.0
2014-12-07T06:22:36.450Z
2014-12-07T06:22:36.450Z
gabrielmoreira
<p>I've been using <a href="http://laravel.com/docs/4.2/homestead" rel="nofollow">Laravel Homestead</a> for local dev (and <a href="https://forge.laravel.com" rel="nofollow">Forge</a> controlled VPS' for staging). Both have been hugely successful for me – I've not touched MAMP for months.</p>

<p>Craft works off-the-shelf with both.</p>

CC BY-SA 3.0
2014-11-17T16:37:11.377Z
Niceeeeeee. Thanks for this. Giving it a shot now!
Bill Columbia
CC BY-SA 3.0
2014-11-17T16:39:07.597Z
I notice Homestead 2 was just announced today, I've not had a chance to try this version yet but I'd guess it should all be fine.
Steve Abraham
CC BY-SA 3.0
2014-11-17T16:59:37.833Z
I'm giving it a shot now. Will let you know my success as well.
Bill Columbia
CC BY-SA 3.0
2014-11-17T18:06:23.077Z
This may (or may not) be helpful: https://laracasts.com/lessons/say-hello-to-laravel-homestead-two
Steve Abraham
CC BY-SA 3.0
2014-11-18T03:42:21.590Z
So it definitely works. However, I noticed that once I run `homestead destroy`, my database is purged. Do you connect to a remote database or one locally? If locally, how do you keep it from being destroyed when you restart your machine or homestead?

I did notice the suspend command, but wonder what happens if I forget :x
Bill Columbia
CC BY-SA 3.0
2014-11-18T09:41:34.877Z
I always use local DB. You shouldn't really have any need to destroy the environment (I never do). You're maybe looking for `vagrant suspend`? Personally I leave it as-is and just issue a `vagrant up` if I ever have to reboot the host machine.
Steve Abraham
CC BY-SA 3.0
2014-11-18T16:34:28.970Z
Interesting. Looks like it wasn't an issue when I just restarted. I guess I assumed you would need to destroy and restart it each time. This is pretty rad.
Bill Columbia
CC BY-SA 3.0
2014-11-18T17:41:58.087Z
Indeed! I never touch it apart from a `vagrant provision` if I add any new vhosts.
Steve Abraham
CC BY-SA 3.0
2014-11-17T11:26:46.667Z
2014-11-17T11:26:46.667Z
Steve Abraham
<p>For anyone who is interested - I did a quick mashup of the Craft and Laravel Homestead documentation to outline the process I went through for setting up my first Craft site locally on a Vagrant/Homestead box.</p>

<p>Thanks to the guys over at Straight Up Craft for the video about Vagrant and Craft which introduced me to Homestead﻿</p>

<p><a href="https://medium.com/@mattcollins_6/setting-up-a-local-dev-environment-for-craft-cms-using-laravel-homestead-2724be3954a5" rel="nofollow">https://medium.com/@mattcollins_6/setting-up-a-local-dev-environment-for-craft-cms-using-laravel-homestead-2724be3954a5</a></p>

CC BY-SA 3.0
2014-12-12T00:48:43.893Z
2014-12-12T00:48:43.893Z
Matt
<p>Yes I have. I even wrote an article that describes the application I created to automate the install process less than two minutes.</p>

<p><a href="https://medium.com/@bshelling/craft-mac-n-cheez-creates-a-craftcms-docker-dev-environment-in-seconds-33731a1aa685" rel="nofollow noreferrer">CraftCMS + Docker Dev Environment in seconds</a></p>

CC BY-SA 4.0
2019-03-07T02:20:55.340Z
2019-03-07T02:20:55.340Z
bshelling
<p>You might want to check out this tutorial on using vagrant with craft. You could use this as an alternative to MAMP. 
<a href="http://straightupcraft.com/articles/setting-up-craft-with-vagrant" rel="nofollow">http://straightupcraft.com/articles/setting-up-craft-with-vagrant</a></p>

CC BY-SA 3.0
2014-11-17T16:38:06.493Z
Awesome thank you.
Bill Columbia
CC BY-SA 3.0
2014-11-17T18:25:32.703Z
Cool this actually touches on more options other than homestead as well. I got homestead working, and will be giving Forge a go again in light of all this, as well.
Bill Columbia
CC BY-SA 3.0
2014-11-17T09:39:31.860Z
2014-11-17T09:39:31.860Z
Matt
<p>Here's a Docker setup for Craft CMS as a Composer project:</p>
<p><a href="https://github.com/nystudio107/craft" rel="nofollow noreferrer">https://github.com/nystudio107/craft</a></p>
<p>Here is a full Craft website in Docker that you can spin up locally:</p>
<p><a href="https://github.com/nystudio107/devmode" rel="nofollow noreferrer">https://github.com/nystudio107/devmode</a></p>
<p>...and here is a comprehensive article on the Docker setup:</p>
<p><a href="https://nystudio107.com/blog/an-annotated-docker-config-for-frontend-web-development" rel="nofollow noreferrer">https://nystudio107.com/blog/an-annotated-docker-config-for-frontend-web-development</a></p>
<p>related:</p>
<p><a href="https://nystudio107.com/blog/dock-life-using-docker-for-all-the-things" rel="nofollow noreferrer">https://nystudio107.com/blog/dock-life-using-docker-for-all-the-things</a></p>

CC BY-SA 4.0
2022-08-24T15:10:13.583Z
That docker article is super in depth. Probably a really good option for those who want to roll their own setup and are afraid to get their hands dirty!
Bill Columbia
CC BY-SA 4.0
2022-08-24T14:58:42.433Z
2022-08-24T14:58:42.433Z
andrew.welch
<p>Has anyone had success with setting up Craft using <a href="https://www.docker.com/" rel="noreferrer">Docker</a>?</p>

<p>I've stumbled across some <a href="https://github.com/eugeneware/docker-wordpress-nginx" rel="noreferrer">Dockerfiles for WordPress</a> and other CMS's but couldn't find much in the way of Craft. I'll be exploring this a bit myself over the next week, but was hoping some people in the community may have a few good pointers or tips or even cautions.</p>

<p>To elaborate, I'm looking for alternatives to MAMP as well, or other development environment tools for working with Craft.</p>

CC BY-SA 3.0
2014-11-11T12:43:55.133Z
I've been looking at Docker too, I'll be watching for your findings!
Tim Kelty
<environments>
Running Craft with Docker (or something similar)
# Running Craft with Docker (or something similar)

(Asked by: username_0 on 2014-11-08)

Has anyone had success with setting up Craft using [Docker](https://www.docker.com/)?

I've stumbled across some [Dockerfiles for WordPress](https://github.com/eugeneware/docker-wordpress-nginx) and other CMS's but couldn't find much in the way of Craft. I'll be exploring this a bit myself over the next week, but was hoping some people in the community may have a few good pointers or tips or even cautions.

To elaborate, I'm looking for alternatives to MAMP as well, or other development environment tools for working with Craft.

**Tags:** environments
> **Comments:**
> **username_1**: I've been looking at Docker too, I'll be watching for your findings!  

---

## 7 answers

### Answer by username_0 on 2021-01-12. Score: 1 | Accepted answer

As of today the [Craft docs](https://craftcms.com/knowledge-base/migrating-from-craft-nitro-to-ddev) note deprecating [Nitro](https://github.com/craftcms/nitro) in favor of [DDEV](https://ddev.com/) or similar projects.

There is also some good content on [Craft Quest about using DDEV](https://craftquest.io/courses/ddev-and-craft-cms-quick-start-guide/43386).


---

### Answer by username_2 on 2014-12-07. Score: 2

I am creating an image to help me test Craft.

<https://github.com/gabrielmoreira/docker-craft>


---

### Answer by username_3 on 2014-11-17. Score: 2

I've been using [Laravel Homestead](http://laravel.com/docs/4.2/homestead) for local dev (and [Forge](https://forge.laravel.com) controlled VPS' for staging). Both have been hugely successful for me – I've not touched MAMP for months.

Craft works off-the-shelf with both.

> **Comments:**
> **username_0**: Niceeeeeee. Thanks for this. Giving it a shot now!  
> **username_3**: I notice Homestead 2 was just announced today, I've not had a chance to try this version yet but I'd guess it should all be fine.  
> **username_0**: I'm giving it a shot now. Will let you know my success as well.  
> **username_3**: This may (or may not) be helpful: https://laracasts.com/lessons/say-hello-to-laravel-homestead-two  
> **username_0**: So it definitely works. However, I noticed that once I run `homestead destroy`, my database is purged. Do you connect to a remote database or one locally? If locally, how do you keep it from being destroyed when you restart your machine or homestead?  I did notice the suspend command, but wonder what happens if I forget :x  
> **username_3**: I always use local DB. You shouldn't really have any need to destroy the environment (I never do). You're maybe looking for `vagrant suspend`? Personally I leave it as-is and just issue a `vagrant up` if I ever have to reboot the host machine.  
> **username_0**: Interesting. Looks like it wasn't an issue when I just restarted. I guess I assumed you would need to destroy and restart it each time. This is pretty rad.  
> **username_3**: Indeed! I never touch it apart from a `vagrant provision` if I add any new vhosts.  

---

### Answer by username_4 on 2014-12-12. Score: 2

For anyone who is interested - I did a quick mashup of the Craft and Laravel Homestead documentation to outline the process I went through for setting up my first Craft site locally on a Vagrant/Homestead box.

Thanks to the guys over at Straight Up Craft for the video about Vagrant and Craft which introduced me to Homestead﻿

<https://medium.com/@mattcollins_6/setting-up-a-local-dev-environment-for-craft-cms-using-laravel-homestead-2724be3954a5>


---

### Answer by username_5 on 2019-03-07. Score: 1

Yes I have. I even wrote an article that describes the application I created to automate the install process less than two minutes.

[CraftCMS + Docker Dev Environment in seconds](https://medium.com/@bshelling/craft-mac-n-cheez-creates-a-craftcms-docker-dev-environment-in-seconds-33731a1aa685)


---

### Answer by username_4 on 2014-11-17. Score: 1

You might want to check out this tutorial on using vagrant with craft. You could use this as an alternative to MAMP.
<http://straightupcraft.com/articles/setting-up-craft-with-vagrant>

> **Comments:**
> **username_0**: Awesome thank you.  
> **username_0**: Cool this actually touches on more options other than homestead as well. I got homestead working, and will be giving Forge a go again in light of all this, as well.  

---

### Answer by username_6 on 2022-08-24. Score: 0

Here's a Docker setup for Craft CMS as a Composer project:

<https://github.com/nystudio107/craft>

Here is a full Craft website in Docker that you can spin up locally:

<https://github.com/nystudio107/devmode>

...and here is a comprehensive article on the Docker setup:

<https://nystudio107.com/blog/an-annotated-docker-config-for-frontend-web-development>

related:

<https://nystudio107.com/blog/dock-life-using-docker-for-all-the-things>

> **Comments:**
> **username_0**: That docker article is super in depth. Probably a really good option for those who want to roll their own setup and are afraid to get their hands dirty!  

---

