# Vagrant

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/ruby/2026.3/llms.txt).

> **TL;DR**
> Interact with Vagrant from the main menu: `Tools | Vagrant`
>
>
>
> Configure: `Settings | Tools | Vagrant`

> **Note:**
> Starting with version 2026.3, RubyMine does not bundle the Vagrant plugin. To use the features described in this topic, install the Vagrant plugin from [JetBrains Marketplace](managing-plugins.html).
>
>
>
> You cannot create new Vagrant interpreters. Existing Vagrant interpreters stay in the list of interpreters and work after you install the plugin.

[Vagrant](https://www.vagrantup.com/) is a tool for building and managing virtual machine environments defined by `Vagrantfile` configuration files. RubyMine provides integration with Vagrant and allows you to perform all the required actions in your project - from initializing a Vagrant environment to executing Vagrant commands.

This topic covers the main Vagrant capabilities available in RubyMine: configuring Vagrant, adding and removing boxes, and running Vagrant commands.

> **Tip:**
> See the resulting project with Vagrant configured in the [vagrant](https://github.com/JetBrains/sample_rails_app/tree/vagrant) branch of the sample Rails application.

## Prerequisites

To start working with Vagrant, do the following.

* Install [Vagrant](https://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/).

* Make sure that the Vagrant plugin is [enabled](managing-plugins.html).

* If necessary, configure [Vagrant settings](#settings).

## Vagrant init

To initialize a Vagrant environment for the opened project, follow the steps below.

Procedure:

1. Go to `Tools | Vagrant | Init in Project Root`.

2. In the invoked dialog, specify the box name and URL, for example:

* Box name: `ubuntu/bionic64`

* Box URL: `https://app.vagrantup.com/ubuntu/boxes/bionic64`

If you already have several Vagrant boxes, select the desired one in the invoked Select Vagrant Box popup.

3. Wait until RubyMine downloads the specified box and initializes a `Vagrantfile`.

> **Tip:**
> Learn how to add this `Vagrantfile` to VCS at [Add files to Git](adding-files-to-version-control.html#add-files-to-vcs).

4. Change the `Vagrantfile` in the following way:

```RUBY
Vagrant.configure("2") do |config|
    config.vm.box = "ubuntu/bionic64"
    config.vm.synced_folder ".", "/home/vagrant/sample_rails_app"
    config.vm.network "forwarded_port", guest: 3000, host: 3000
end
```

The following settings are specified in this configuration:

* `box`: Specifies the box used to run the virtual machine.

* `synced_folder`: Configures a [virtual machine folder](https://www.vagrantup.com/intro/getting-started/synced_folders.html) to share your local project directory.

* `network`: Specifies options used to connect the virtual machine to the network. Here we've configured the [port](https://www.vagrantup.com/intro/getting-started/networking.html#port-forwarding) on the virtual machine to share via a port on the host machine.

## Vagrant up

After [initializing a Vagrant environment](#init), you can create and run a virtual machine based on the `Vagrantfile` settings.

Procedure:

1. Go to `Tools | Vagrant | Up`.

2. In the browser, select the Vagrant file you configured.

3. If [several machines](https://www.vagrantup.com/docs/multi-machine/) are defined in your `Vagrantfile`, select the desired machine.

![Select virtual machine configuration](https://resources.jetbrains.com/help/img/idea/2026.3/rm_vagrant_select_vm_configuration.png)

4. Wait until RubyMine creates and runs the machine.

![Run tool window: vagrant up](https://resources.jetbrains.com/help/img/idea/2026.3/rm_vagrant_up_run_tool_window.png)

You can now connect to this machine using [SSH](#ssh) to install additional libraries, run the application, and so on.

> **Tip:**
> Apart from executing the [vagrant up](https://www.vagrantup.com/docs/cli/up.html) command from the `Tools | Vagrant` menu, you can perform other commands, including vagrant reload, vagrant provision, and so on.

## SSH into a running machine

To connect to the [running virtual machine](#up), follow the steps below.

Procedure:

1. Go to `Tools | Start SSH session`.

2. In the invoked popup, choose the desired Vagrant host.

3. (Optional) If [several machines](https://www.vagrantup.com/docs/multi-machine/) are running, select the desired one.

4. In the 127.0.0.1 tab of the opened Terminal window, you can execute a shell command, for example, you can install additional libraries, run the application, and so on.

![SSH terminal session](https://resources.jetbrains.com/help/img/idea/2026.3/rm_vagrant_ssh_terminal.png)

## Vagrant settings

You can configure the following Vagrant settings on the `Tools | Vagrant` page of the Settings dialog `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Meta+Comma` (TextMate), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)):

Vagrant executable
: Specify the Vagrant executable file if RubyMine didn't detect it automatically or you want to use a different one.
:
:
:
: Example: `vagrant`

Instance Folder
: Specify the fully qualified path to the directory where the `Vagrantfile` is [initialized](#init) and stored. By default, RubyMine uses the root of your current project to execute Vagrant commands. This directory is used when executing Vagrant commands, such as [vagrant up](#up), vagrant reload, vagrant halt, and so on.
:
:
:
: Example: `/Users/jetbrains/RubymineProjects/sample_rails_app`

Provider
: Select the [provider](https://www.vagrantup.com/docs/providers/) used as a backend to run a virtual machine. You can install the required provider as the Vagrant plugin on the [Plugins tab](#plugins).
:
:
:
: Examples: `aws`, `libvirt`

Environment variables
: Environment variables enable you to pass the required values for configuring a [provider](#provider). To specify environment variables, click the Browse button (`Shift+Enter` (Windows), `⇧ ⏎` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⇧ ⏎` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Ctrl+Enter` (Sublime Text), `⌘ ⏎` (Sublime Text (macOS)), `Shift+Enter` (Visual Studio), `⇧ ⏎` (Visual Studio (macOS)), `Shift+Enter` (TextMate), `Shift+Enter` (NetBeans), `Shift+Enter` (Eclipse), `⇧ ⏎` (Eclipse (macOS))). For example, the [vagrant-aws](https://github.com/mitchellh/vagrant-aws) provider allows you to pass your [AWS credentials](https://docs.aws.amazon.com/amazonswf/latest/awsrbflowguide/set-up-creds.html) using the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables. You can read variable values in `Vagrantfile` when instantiating AWS instances.
:
:
:
:
: ```RUBY
: config.vm.provider 'aws' do |aws|
: aws.access_key_id = ENV['AWS_ACCESS_KEY_ID']
: aws.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
: # ...
: end
: ```

Boxes
: This list shows the available Vagrant boxes. To add a new box, click the ![Add](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg) button `Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Ctrl+N` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Ctrl+N` (Visual Studio), `⌘ N` (Visual Studio (macOS)), `Meta+Shift+N` (TextMate), `Alt+Insert` (NetBeans), `Alt+Insert` (Eclipse), `⌘ N` (Eclipse (macOS)) and specify the box name and URL. For example:
:
:
:
: * Box name: `ubuntu/bionic64`
:
: * Box URL: `https://app.vagrantup.com/ubuntu/boxes/bionic64`
:
:
:
: To remove a selected box, click the ![the Remove button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.remove.svg) button `Alt+Delete` (Windows), `⌘ ⌦` (macOS), `⌘ ⌦` (IntelliJ IDEA Classic (macOS)), `⌘ ⌦` (macOS System Shortcuts), `Alt+Delete` (XWin), `Alt+Delete` (GNOME), `Alt+Delete` (KDE), `Alt+Delete` (Emacs), `Alt+Delete` (Sublime Text), `⌘ ⌦` (Sublime Text (macOS)), `Ctrl+R, D` (Visual Studio), `⌘ R, D` (Visual Studio (macOS)), `Meta+Delete` (TextMate), `Alt+Delete` (NetBeans), `Alt+Delete` (Eclipse), `Alt+Delete` (Eclipse (macOS)).

Plugins
: Use this table to add, remove, and update [Vagrant plugins](https://github.com/hashicorp/vagrant/wiki/Available-Vagrant-Plugins). For example, to install the [vagrant-aws](https://github.com/mitchellh/vagrant-aws) plugin, click the ![Add](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg) button `Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Ctrl+N` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Ctrl+N` (Visual Studio), `⌘ N` (Visual Studio (macOS)), `Meta+Shift+N` (TextMate), `Alt+Insert` (NetBeans), `Alt+Insert` (Eclipse), `⌘ N` (Eclipse (macOS)), enter `vagrant-aws` in the invoked dialog and click OK.

