# Tutorial: deploy your application to a minikube cluster

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

Running Kubernetes locally is especially useful for prototyping, testing deployments, and learning Kubernetes workflows. Using the Docker and Kubernetes support available in RubyMine, you will be able to start the cluster, deploy resources, and inspect your application without leaving the IDE.

## Before you start

Before you start, make sure that you have the following installed and configured:

* [Docker Desktop](https://docs.docker.com/get-started/introduction/get-docker-desktop/) running

* [minikube](https://minikube.sigs.k8s.io/docs/start/?arch=%2Fmacos%2Farm64%2Fstable%2Fbinary+download)

### Enable required plugins

The functionality used in this tutorial relies on the following plugin:

* [Kubernetes](https://plugins.jetbrains.com/plugin/10485-kubernetes)

The plugin is bundled and enabled in RubyMine by default. If the relevant feature is not available, make sure that you did not disable the plugin.

Procedure:

1. Press `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)) to open settings and then select `Plugins`.

2. Find the required plugins and toggle them on.

## Create a Rails application

In this chapter, you will learn how to create a Rails application and run it.

Procedure:

1. Run RubyMine and click New Project on the [Welcome Screen](null).

![Welcome screen](https://resources.jetbrains.com/help/img/idea/2026.3/rm_welcome_screen_empty.png)

2. In the New Project dialog, select Application in the Rails group  Ruby on Rails in the Project Type group on the left pane.

3. Specify the following settings:

![New Project dialog: Rails application](https://resources.jetbrains.com/help/img/idea/2026.3/rm_new_project_dialog_rails.png)

* Name: specify a name for the project (rails-helloworld in our case).

* Location: specify a path to the directory in which you want to create the project. By default, RubyMine creates a directory with the same name as the project.

* Interpreter: select a [Ruby interpreter](configuring-language-interpreter.html) that you want to use in your project.

* Rails version: select a Rails version that you want to use in your project. If the Rails gem is not installed in the selected interpreter or the necessary Rails version is missing, click ![the Install Rails Gem button](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg) in the field. Wait until RubyMine downloads all available Rails versions and select the necessary version from the dropdown. Click OK to continue. ![Install rails gem](https://resources.jetbrains.com/help/img/idea/2026.3/rm_install_rails_gem_dialog.png) If the selected version is not installed yet, RubyMine will install it upon project creation.

* Extra options: provide additional Rails options for project creation in the Extra options field. For example, you can specify [arguments](https://guides.rubyonrails.org/command_line.html#rails-new) that you will normally use to append the `rails new` command: `--skip-tests` to skip creation of test files, `--skip-action-mailer` to skip Action Mailer files, `--skip-action-cable` to skip Action Cable files, and so on. To get a full list of Rails options compatible with the Rails version in use, run the `rails new --help` command. > **Tip:** > If you're using Rails 7 and later, you can select a CSS framework when creating your application. For this purpose, use the `--css` Rails option. For example, `--css=tailwind`.

4. Click Create to close the New Project dialog.

5. RubyMine creates a new Rails application, installs the gem dependencies mentioned in `Gemfile`, and installs JavaScript dependencies mentioned in the project's `package.json` file. You can see this process in the Run tool window.

![Generating Rails Application for a project](https://resources.jetbrains.com/help/img/idea/2026.3/rm_new_project_rails_output.png)

6. After installing all dependencies, you can see the project structure in the Project tool window (`Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+Alt+L` (Visual Studio), `⌘ ⌥ L` (Visual Studio (macOS)), `Meta+1` (TextMate), `Ctrl+1` (NetBeans), `Alt+1` (Eclipse), `Alt+1` (Eclipse (macOS))) on the left. On the right, RubyMine automatically opens the main project files in the editor.

![New Rails Application](https://resources.jetbrains.com/help/img/idea/2026.3/rm_new_project_rails_ide.png)

If you have Git installed in your operating system, generating a new Rails application also initializes a Git repository. You can learn how to work with Version control systems in RubyMine from the [Version control](version-control-integration.html) section.

7. Now we have a functioning Rails application. To see it in action, you need to start a web server. Perform the following steps to do this:

1. Click the Run icon in the upper right corner.

2.

RubyMine will show the process of preparing the application to run.

![Rails server output](https://resources.jetbrains.com/help/img/idea/2026.3/rm_new_project_rails_server_output.png)

3.

Open `http://127.0.0.1:3000` in your browser to see the Rails default information page.

![Rails default page](https://resources.jetbrains.com/help/img/idea/2026.3/rm_new_project_rails_browser.png)

## Containerize the application

In this step, you will package the built application into a Docker image. Kubernetes will run this image later as a container in a pod.

Procedure: Build the Docker image

> **Note:**
> Before proceeding, make sure that [Docker Desktop](https://docs.docker.com/get-started/introduction/get-docker-desktop/) is running on your machine.

1. From the Project view, open `Dockerfile` in the editor .

2. Edit the file:

* Change ```DOCKERFILE ENV RAILS_ENV="production" \ BUNDLE_DEPLOYMENT="1" \ BUNDLE_PATH="/usr/local/bundle" \ BUNDLE_WITHOUT="development" ``` to ```DOCKERFILE ENV RAILS_ENV="development" \ BUNDLE_PATH="/usr/local/bundle" ```

* Change ```DOCKERFILE EXPOSE 80 CMD ["./bin/thrust", "./bin/rails", "server"] ``` to ```DOCKERFILE EXPOSE 3000 CMD ["./bin/rails", "server", "-b", "0.0.0.0", "-p", "3000"] ```

3. In the gutter inside the Dockerfile, click ![The Run on Docker icon](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.runAll.svg) and select New Run Configuration.

4. In the Edit Run Configuration dialog, specify `rails-minikube-app` in the Image tag field and `rails-minikube` in the Container name field. Then, click Run.

RubyMine creates a [Dockerfile run configuration](dockerfile-run-configuration.html), which builds an image from the Dockerfile and then runs a container based on that image.   To follow the whole process, open the Log tab in the Services tool window.

## Connect to minikube

Now that you have a Docker image with your application, you need to start a local Kubernetes cluster to deploy it to. We will use minikube to run a local, single-node Kubernetes cluster directly from RubyMine.

Procedure: Start minikube with the Docker driver

1. Open the Terminal tool window: go to `View | Tool Windows | Terminal` or press `Alt+F12` (Windows), `⌥ F12` (macOS), `⌥ F12` (IntelliJ IDEA Classic (macOS)), `⌘ ⌃ T` (macOS System Shortcuts), `Alt+F12` (XWin), `Alt+F12` (GNOME), `Alt+F12` (KDE), `Alt+F12` (Emacs), `Alt+F12` (Sublime Text), `⌥ F12` (Sublime Text (macOS)), `Ctrl+Alt+1` (Visual Studio), `⌘ ⌃ 1` (Visual Studio (macOS)), `Alt+F12` (TextMate), `Alt+F12` (NetBeans), `Alt+F12` (Eclipse), `⌥ F12` (Eclipse (macOS)).

2. Run the following command to start a local Kubernetes cluster and instruct minikube to use Docker as the virtualization driver:

```BASH
minikube start --driver=docker
```

3. Verify that your cluster is up and running by using the command:

```BASH
minikube status
```

Using the Docker driver runs the minikube cluster inside Docker containers, providing a lightweight environment well suited for local development.

Procedure: Add the minikube cluster to RubyMine

1. Open the [Services](services-tool-window.html) tool window: go to `View | Tool Windows | Services` or press `Alt+8` (Windows), `⌘ 8` (macOS), `⌘ 8` (IntelliJ IDEA Classic (macOS)), `⌘ 8` (macOS System Shortcuts), `Alt+8` (XWin), `Alt+8` (GNOME), `Alt+8` (KDE), `Alt+8` (Emacs), `Alt+8` (Sublime Text), `⌘ 8` (Sublime Text (macOS)), `Alt+8` (Visual Studio), `Alt+8` (Visual Studio (macOS)), `Meta+8` (TextMate), `Alt+8` (NetBeans), `Alt+8` (Eclipse), `⌘ 8` (Eclipse (macOS)).

2. Select the Kubernetes node, click the Add Cluster button, and then select From Default Directory from the context menu.

![Adding a new cluster from the Kubernetes welcome screen in the Services tool window](https://resources.jetbrains.com/help/img/idea/2026.3/k8s-welcome-screen-add-cluster.png)

3. In the Add Clusters dialog, select minikube and click Add Clusters.

![Add Clusters dialog](https://resources.jetbrains.com/help/img/idea/2026.3/rm_add_clusters_dialog.png)

The added cluster will become available in the Services tool window.

4. In the Services tool window, right-click the minikube cluster and select Connect Cluster.

![Connect to the minikube cluster](https://resources.jetbrains.com/help/img/idea/2026.3/ij-connect-cluster.png)

At this point, RubyMine is connected to the running minikube cluster and can display its Kubernetes resources. You can explore namespaces, nodes, and other cluster objects directly from the Services tool window.

## Deploy the application

Earlier in the tutorial, you already [built the application image
locally](#build-docker-image). However, the minikube cluster cannot automatically access images from your local Docker daemon. You need to load the image into minikube to make it available.

Procedure: Load the Docker image into minikube

1. Open the Terminal tool window: go to `View | Tool Windows | Terminal` or press `Alt+F12` (Windows), `⌥ F12` (macOS), `⌥ F12` (IntelliJ IDEA Classic (macOS)), `⌘ ⌃ T` (macOS System Shortcuts), `Alt+F12` (XWin), `Alt+F12` (GNOME), `Alt+F12` (KDE), `Alt+F12` (Emacs), `Alt+F12` (Sublime Text), `⌥ F12` (Sublime Text (macOS)), `Ctrl+Alt+1` (Visual Studio), `⌘ ⌃ 1` (Visual Studio (macOS)), `Alt+F12` (TextMate), `Alt+F12` (NetBeans), `Alt+F12` (Eclipse), `⌥ F12` (Eclipse (macOS)).

2. Run the following command to build the container image in minikube:

```BASH
minikube image load <image tag>
```

where <image tag> is the value specified in the Run/Debug configuration [as described above](#run_debug_config_specify_image_tag_and_container_name). In our example it should be:

```BASH
minikube image load hello-world-docker-app
```

3. Validate that the `rails-minikube-app` image is available in your cluster by running:

```BASH
minikube image ls | grep rails-minikube-app
```

You should see `docker.io/library/rails-minikube-app:latest` in the output.

Now that the image is available in minikube, the next step is to describe how Kubernetes will run it. Let us create two Kubernetes manifests:

* Deployment, which helps you run your container in a pod

* Service, which exposes your app so that you can access it from your machine

Procedure: Create a Deployment manifest

1. In the   Project tool window  (`Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+Alt+L` (Visual Studio), `⌘ ⌥ L` (Visual Studio (macOS)), `Meta+1` (TextMate), `Ctrl+1` (NetBeans), `Alt+1` (Eclipse), `Alt+1` (Eclipse (macOS))) , right-click the project name and select `New | Kubernetes Resource`.

![Create a Kubernetes resource](https://resources.jetbrains.com/help/img/idea/2026.3/rm_create_kubernetes_resource.png)

2. In the New Kubernetes Resource dialog, select the Deployment file type, specify    as the manifest name, and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (TextMate), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

![Create a new Deployment](https://resources.jetbrains.com/help/img/idea/2026.3/ij-petclinic-new-deployment.png)

If prompted, agree to add the file to Git.

3. Replace the content of the resulting   file with the following code:

```YAML
                   apiVersion: apps/v1
kind: Deployment
metadata:
  name: rails-minikube
  labels:
    app: rails-minikube
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rails-minikube
  template:
    metadata:
      name: rails-minikube
      labels:
        app: rails-minikube
    spec:
      containers:
        - name: rails-minikube
          image: rails-minikube-app
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 3000
              protocol: TCP
      restartPolicy: Always
```

4. On the [floating toolbar](kubernetes.html#floating-toolbar), select the current cluster and namespace, then click ![Apply icon](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.actions.deploy.svg) Apply to deliver the changes to the local cluster.

Procedure: Create a Service manifest

1. In the   Project tool window  (`Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+Alt+L` (Visual Studio), `⌘ ⌥ L` (Visual Studio (macOS)), `Meta+1` (TextMate), `Ctrl+1` (NetBeans), `Alt+1` (Eclipse), `Alt+1` (Eclipse (macOS))) , right-click the project name and select `New | Kubernetes Resource`.

![Create a Kubernetes resource](https://resources.jetbrains.com/help/img/idea/2026.3/rm_create_kubernetes_resource.png)

2. In the New Kubernetes Resource dialog, select the Service file type, specify    as the manifest name, and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (TextMate), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

If prompted, agree to add the file to Git.

3. Replace the content of the resulting   file with the following code:

```YAML
                    apiVersion: v1
kind: Service
metadata:
  name: rails-minikube
spec:
  selector:
    app: rails-minikube
  ports:
    - protocol: TCP
      port: 3000
      targetPort: 3000
  type: NodePort

```

4. On the [floating toolbar](kubernetes.html#floating-toolbar), select the current cluster and namespace, then click ![Apply icon](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.actions.deploy.svg) Apply to deliver the changes to the local cluster.

Procedure: Access the application

1. Open the  file in the editor.

2. Click the Forward Ports inlay hint next to the `- containerPort: 8080` property.

> **Tip:**
> After RubyMine starts a new port-forwarding session, the Forward Ports inlay hint changes to Open in Browser.

3. In the Forward Ports dialog, leave the default values and click Forward.

4. In the  file, click the Open in Browser inlay hint.

You have learned how to deploy a Rails application to a local Kubernetes cluster using minikube and RubyMine. This approach enables quick local testing and experimentation with Kubernetes without requiring a remote cluster.

## Next steps

Learn how to work with Kubernetes from these topics:

* [View logs](kubernetes.html#view-logs)

* [Manage your cluster](kubernetes.html#manage_cluster)

* [Debug in Kubernetes](debugging-in-kubernetes.html)

