Vagrant lets you easily package an environment and share it with anyone.
YES! You can run vagrant on the most popular operating systems;
Microsoft Windows, Mac and Linux (most flavours).
First thing you need to do is install VirtualBox:
(Vagrant uses a "headless" VirtualBox Virtual Machine (VM) - you don't need to know what that is or how it works just trust that it does its job really well, is well documented and extensively tested)
and Vagrant:
git clone https://github.com/nelsonic/learn-vagrant.git && cd learn-vagrant
This means that you will now have the only file you need in your directory to get Vagrant up and running: the Vagrantfile. This file adds the configuration you need to the vagrant box.
The one in this repository updates Ubuntu, installs Node.js, updates it and prints out the version. There is also commented out code there that would have installed MongoDB and run some tests. If you're setting up your own configuration, copying this file would be a good place to start!
Windows users will also need a vagrantfile_ssh.txt
file - in the windows-only
directory of this repository.
Boot the Vagrant Box:
(this will install ubuntu and node.js so may take a few minutes - depending on your internet connection)
Anything you do within the directory you're currently in will now take place exclusively in your Vagrant environment.
SSH (login) to the Vagrant Box:
to exit simply type exit
in the terminal (this logs you out but Vagrant will still be running):
Because windows does not come with an SSH client you will need to install one.
Shut down the Vagrant Box
- investigate best way to enable ssh on windows!
- http://docs-v1.vagrantup.com/v1/docs/getting-started/ssh.html
- http://stackoverflow.com/questions/9885108/ssh-to-vagrant-box-in-windows
This will shut down while preserving the state of the machine, much like hitting the 'pause' button.
This will stop the machine altogether and you will no longer be operating within Vagrant in the directory.
More Detailed InstructionsCreate our base Ubuntu Box:
vagrant box add base https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box
This command will create a box called "base" and download the base install of ubuntu version 14.04 (latest)
you should see:
==> box: Adding box 'base' (v0) for provider:
box: Downloading: https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box
==> box: Successfully added box 'base' (v0) for 'virtualbox'!
This will be useful if you want to install the box globally so that you don't have to download and install it through the Vagrantfile every time you run vagrant up
.
Install Node.js on Unbunt:
For better or worse, people still use different operating systems for their development machines. While many have made the switch to Mac or Ubuntu, most people are still developing on Windows. Using vagrant as a VM to run your production OS locally means you can keep everything consistent everywhere, regardless of your local OS.
In the dark ages of development (pre 2012) people had to manually install all the dependencies for projects, often leading to version conflicts and incompatibilities. 😢
Enter Vagrant to save the day!
Now you can keep a single file listing all the dependencies required to boot a fully-functional development machine using a single vagrant up
command.
Vagrant on Digital Ocean / AWS ?
Special Thanks to Joaquim Serafim for encouraging me to learn/use Vagrant
see: https://github.com/joaquimserafim/vagrant-nodejs-redis-mongodb
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4