2013-09-03 18:08:28 +00:00
|
|
|
---
|
2017-03-28 01:19:52 +00:00
|
|
|
layout: "intro"
|
2013-09-06 16:50:43 +00:00
|
|
|
page_title: "Project Setup - Getting Started"
|
2013-09-03 18:08:28 +00:00
|
|
|
sidebar_current: "gettingstarted-projectsetup"
|
2016-01-19 18:08:53 +00:00
|
|
|
description: |-
|
|
|
|
The first step in configuring any Vagrant project is to create a Vagrantfile.
|
2013-09-03 18:08:28 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Project Setup
|
|
|
|
|
2015-02-09 14:40:20 +00:00
|
|
|
The first step in configuring any Vagrant project is to create a
|
2016-01-19 18:08:53 +00:00
|
|
|
[Vagrantfile](/docs/vagrantfile/). The purpose of the
|
2013-09-03 18:08:28 +00:00
|
|
|
Vagrantfile is twofold:
|
|
|
|
|
2016-01-19 18:08:53 +00:00
|
|
|
1. Mark the root directory of your project. Many of the configuration
|
|
|
|
options in Vagrant are relative to this root directory.
|
2013-09-03 18:08:28 +00:00
|
|
|
|
|
|
|
2. Describe the kind of machine and resources you need to run your project,
|
2016-01-19 18:08:53 +00:00
|
|
|
as well as what software to install and how you want to access it.
|
2013-09-03 18:08:28 +00:00
|
|
|
|
|
|
|
Vagrant has a built-in command for initializing a directory for usage
|
|
|
|
with Vagrant: `vagrant init`. For the purpose of this getting started guide,
|
|
|
|
please follow along in your terminal:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ mkdir vagrant_getting_started
|
|
|
|
$ cd vagrant_getting_started
|
2019-08-14 17:48:33 +00:00
|
|
|
$ vagrant init hashicorp/bionic64
|
2013-09-03 18:08:28 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
This will place a `Vagrantfile` in your current directory. You can
|
|
|
|
take a look at the Vagrantfile if you want, it is filled with comments
|
2016-01-19 18:08:53 +00:00
|
|
|
and examples. Do not be afraid if it looks intimidating, we will modify it
|
2013-09-03 18:08:28 +00:00
|
|
|
soon enough.
|
|
|
|
|
|
|
|
You can also run `vagrant init` in a pre-existing directory to
|
2013-12-12 23:42:01 +00:00
|
|
|
set up Vagrant for an existing project.
|
2013-09-03 18:08:28 +00:00
|
|
|
|
|
|
|
The Vagrantfile is meant to be committed to version control with
|
|
|
|
your project, if you use version control. This way, every person working
|
|
|
|
with that project can benefit from Vagrant without any upfront work.
|
2014-12-19 15:38:56 +00:00
|
|
|
|
2016-01-19 18:08:53 +00:00
|
|
|
## Next Steps
|
|
|
|
|
|
|
|
You have successfully created your first project environment. Read on to learn
|
2017-03-28 01:19:52 +00:00
|
|
|
more about [Vagrant boxes](/intro/getting-started/boxes.html).
|