RubyMine 2026.1 Help

Tutorial: deploy your application to a minikube cluster

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:

Enable required plugins

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

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.

  1. Press Ctrl+Alt+S to open settings and then select Plugins.

  2. Open the Installed tab, find the required plugins, and select the checkboxes next to the plugin names to enable them.

Create a Rails application

To create a Rails application from scratch, do the following:

  1. Run RubyMine and click New Project on the Welcome Screen.

    Welcome screen
  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
    • 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 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 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

      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 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.

  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
  6. After installing all dependencies, you can see the project structure in the Project tool window (Alt+1) on the left. On the right, RubyMine automatically opens the main project files in the editor.

    New Rails Application

    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 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
    3. Open http://127.0.0.1:3000 in your browser to see the Rails default information page.

      Rails default page

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.

Build the Docker image

  1. Form the Project view, open Dockerfile in the editor.

  2. Edit the file:

    • Change

      ENV RAILS_ENV="production" \ BUNDLE_DEPLOYMENT="1" \ BUNDLE_PATH="/usr/local/bundle" \ BUNDLE_WITHOUT="development"

      to

      ENV RAILS_ENV="development" \ BUNDLE_PATH="/usr/local/bundle"
    • Change

      EXPOSE 80 CMD ["./bin/thrust", "./bin/rails", "server"]

      to

      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 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, 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.

Start minikube with the Docker driver

  1. Open the Terminal tool window: go to View | Tool Windows | Terminal or press Alt+F12.

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

    minikube start --driver=docker
  3. Verify that your cluster is up and running by using the command:

    minikube status

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

Add the minikube cluster to RubyMine

  1. Open the Services tool window: go to View | Tool Windows | Services or press Alt+8.

  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
  3. In the Add Clusters dialog, select minikube and click Add Clusters.

    Add Clusters dialog

    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

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. 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.

Load the Docker image into minikube

  1. Open the Terminal tool window: go to View | Tool Windows | Terminal or press Alt+F12.

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

    minikube image load <image tag>

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

    minikube image load hello-world-docker-app
  3. Validate that the rails-minikube-app image is available in your cluster by running:

    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

Create a Deployment manifest

  1. In the Project tool window (Alt+1) , right-click the project name and select New | Kubernetes Resource.

    Create a Kubernetes resource
  2. In the New Kubernetes Resource dialog, select the Deployment file type, specify as the manifest name, and press Enter.

    Create a new Deployment

    If prompted, agree to add the file to Git.

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

    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, select the current cluster and namespace, then click Apply icon Apply to deliver the changes to the local cluster.

Create a Service manifest

  1. In the Project tool window (Alt+1) , right-click the project name and select New | Kubernetes Resource.

    Create a Kubernetes resource
  2. In the New Kubernetes Resource dialog, select the Service file type, specify as the manifest name, and press Enter.

    If prompted, agree to add the file to Git.

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

    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, select the current cluster and namespace, then click Apply icon Apply to deliver the changes to the local cluster.

Access the application

  1. Open the file in the editor.

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

  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:

26 May 2026