[shamless plug] An easy to use 100mb PHP development vagrant box with HTTPS support

I don’t know if shameless plugs are allowed here but I just released a new version of my minimal web development virtual machine. I originally created this for my university students but it may be useful for anyone who wants a quick and easy PHP/MySQL development environment.

Details here: https://r.je/vje-minimal-virtual-server.html Please note: it requires vagrant 2.1.

If you just want to quickly get up and running with PHP development, it’s a lot quicker and easier than than most alternatives (scotch/box, laravel/homestead/puphpet/etc).

Advantages over alternatives:

  1. The download size is a lot smaller. Creating a homestead or scotch/box vm takes a long time if your internet connection isn’t great. They are 1.5 and 1.2 gigabytes respectively to download. vje/min is 97.6mb.

  2. It’s easy to use just run

vagrant init vje/min
vagrant up

Then visit https://v.je in your browser. (You will need Vagrant and Virtualbox installed).

  1. It uses HTTPS with a valid SSL certificate from let’s encrypt without any configuration. A feature that’s very difficult to set up with alternatives. This will help you prevent issues that arise from moving your website developed on aa HTTP server to a production server that uses HTTPS.

  2. It’s portable. You can run vagrant halt on one machine, copy the directory to a USB drive, network storage, or send it to a colleague. They can run vagrant up and the entire site is visible. With alternatives you have to manually export then import your MySQL database each time.

  3. You don’t need to touch the HOSTS file and you can host multiple websites on subdomains e.g https://mysite.v.je without any configuration, just create the folder mysite.

This isn’t for everyone. It’s useful for anyone who wants a quick LAMP* stack for developing PHP. If you want to install additional software, use older PHP versions or have dev/production parity then Puphpet or similar is a far better choice.

* ok it’s not LAMP as it uses NGINX but you know what I mean

4 Likes

They are in the Showcase section. That’s what it’s for. smile

1 Like

aha, thanks for moving the post :slight_smile:

1 Like

If size and portability is a concern, why Vagrant over Docker?

I don’t ever hear of Vagrant anymore, it seems almost everyone has migrated to Docker.

PHP and MySQL: Novice to Ninja uses Vagrant.

Docker adds a significant amount of complexity that just isn’t worth it for a development environment. I’m not a fan of it for that reason, but for my particular use-case (creating a base-box for my university students to use in class) it was a non-starter:

  • It requires Hyper-V and Hyper-V disables all other Hypervisors. We need to use VMWare on the lab machines for different classes
  • Hyper-V requires administrator level access to create/manage a VM. I think you can get around this, but as I understand it, anyone could then see all the VMs on the machine.

Admittedly, it was a year or so ago when I looked into it. Hyper-V may play nicely with other hypervisors or Docker may be able to use a different one.

Docker adds a significant amount of complexity

Really? Why do you say that? The big appeal of Docker is that it’s incredibly simple to build, run, maintain, and deploy.

But yeah, I can get the other problems. I’m not sure how Docker would perform on a VM instead of the root install, but that would be my first attempt.

It also sounds like you need each student to have their own VM, which also makes sense and wouldn’t be a good use case for Docker.

edit: it looks like that should be ok https://blog.docker.com/2016/04/containers-and-vms-together/

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.