Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m

Next lesson playing in 5 seconds


Free Preview: Easy Node.js Development Environment With Vagrant


  • Overview
  • Transcript

When developing a Node.js app, you will probably need one or more of these dependencies: a database server, a key-value store, a background worker or a search engine. Installing and running these on your local machine gets messy fast. Data from your app can also interfere with other apps you are developing on the same system.

With Vagrant you can isolate these dependencies in a virtual machine, start and stop them all together, and save yourself having to set up everything all over when your system crashes or when you move to a new computer. In this course, you will learn how to create a virtual machine with Vagrant, configure it for Node.js development, and share it with others.

1. Introduction

1.1 Introduction

Hi, and welcome to Easy Node.js Development Environment with Vagrant. My name is Markus Muhlberger. And in this course I will teach you how to use Vagrant to set up a virtual machine, hosting all your database dependencies and whatever else you need to develop a Node application. But why should you use Vagrant? You can also set up the database server on your local machine. There are two major advantages when using virtualization. First, your dependencies are isolated and can not mess with other projects on your system. Second, if your Node app gets more complex, you will have to set up more and more dependencies, and so does everyone else on your team. When using Vagrant, you can already have a preconfigured box to get you started in seconds. We are going to use a contacts application with a read-in session store, that can generate sample contacts by a socket IO channel to simulate a more or less complex node.js web application. And you will learn how to create a Vagrant box, set it up for development, and then share it with others. So let's get started.

1.2 Installing VirtualBox and Vagrant

Hi, welcome back to EasyNote Jazz Development and Violin with Vagrant. In this lesson we'll install everything to get ready to use Vagrant. First of all we will need a virtualization software, and we'll be using VirtualBox for that throughout the course. It's available for free and works quite well with Vagrant. If you're using Windows you also have the option to use HyperV, which is available by default in Windows 8.1. So go to VirtualBox.org > Downloads and select the install package you need for your operating system. The second thing we'll need is Vagrant itself. It's available at vagrantup.com and also offers installer packages for all major systems. I've already downloaded both packages for Mac OS 10, so let's install them. The Virtual Box installer is just a basic installation package. You most likely have seen such already. The Vagrant installer is a package as well. If you want to upgrade Vagrant to a new version later on, you will have to download and run the installer again. If you're using Windows, there is a small caveat. There is a back in Ruby for Windows that prevents it to work properly, if there are spaces in the path. Since Vagrant depends on Ruby be sure your Vagrant install path doesn't contain any spaces. The install already suggests the space free path but keep that in mind if you ever want to customize it. Also, Windows users might want to get GitHub for windows. Vagrant is a terminal only tool. It takes the application and comes packaged with the Unix lifeshell. Now, that we've got Virtual Box and Vagrant installed, we can test if everything works properly. Open up your terminal and type in the command vagrant. If you get this help output, you're good to go. In our next lesson, I will explain the additional steps you'll have to do, if you want to use Vagrant with.