Top Related Projects
Linux virtual machines, with a focus on running containers
Podman Desktop - A graphical tool for developing on containers and Kubernetes
Container runtimes on macOS (and Linux) with minimal setup
Run Kubernetes locally
Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
Quick Overview
Rancher Desktop is an open-source desktop application that brings Kubernetes and container management to the desktop. It provides a user-friendly interface for running Kubernetes and Docker containers locally, making it easier for developers to work with containerized applications on their personal machines.
Pros
- Easy-to-use graphical interface for managing Kubernetes clusters and containers
- Cross-platform support (Windows, macOS, and Linux)
- Integrates well with existing Rancher ecosystem and tools
- Simplifies local development and testing of containerized applications
Cons
- May consume significant system resources, especially on older hardware
- Limited advanced configuration options compared to command-line alternatives
- Potential learning curve for users new to Kubernetes and container concepts
- Occasional stability issues reported by some users
Getting Started
To get started with Rancher Desktop:
- Visit the Rancher Desktop releases page on GitHub.
- Download the appropriate installer for your operating system.
- Run the installer and follow the on-screen instructions.
- Launch Rancher Desktop after installation.
- Choose your preferred container runtime (Docker or containerd) and Kubernetes version.
- Wait for the initial setup to complete.
- Start using Rancher Desktop to manage your local Kubernetes cluster and containers.
For more detailed instructions and documentation, visit the Rancher Desktop documentation.
Competitor Comparisons
Linux virtual machines, with a focus on running containers
Pros of Lima
- Lightweight and focused on Linux VM management
- Highly customizable with YAML configurations
- Supports multiple VM instances simultaneously
Cons of Lima
- Less user-friendly for non-technical users
- Limited built-in container management features
- Requires more manual setup for Docker-like functionality
Code Comparison
Lima configuration example:
images:
- location: "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img"
arch: "x86_64"
digest: "sha256:b4a5ea3e6ccb9d4e4f1e3e4c1c8d5e848a5f3e9b5e2f7f9d2a6b8d9c8e7f6d5e4"
Rancher Desktop configuration example:
{
"kubernetes": {
"version": "v1.21.5+k3s2",
"containerEngine": "containerd"
},
"images": {
"kubernetes": "rancher/k3s"
}
}
Lima focuses on VM configuration, while Rancher Desktop emphasizes Kubernetes and container engine settings. Lima offers more granular control over the VM image, while Rancher Desktop provides a higher-level abstraction for container orchestration.
Both projects aim to simplify local development environments, but Lima is more flexible for custom VM setups, whereas Rancher Desktop offers a more integrated solution for container and Kubernetes workflows.
Podman Desktop - A graphical tool for developing on containers and Kubernetes
Pros of Podman Desktop
- Supports multiple container engines (Podman, Docker, Lima)
- Rootless container management for enhanced security
- Native support for pods and Kubernetes-like features
Cons of Podman Desktop
- Less mature project with potentially fewer features
- May have a steeper learning curve for Docker users
- Limited integration with cloud services compared to Rancher Desktop
Code Comparison
Podman Desktop (JavaScript):
const { ipcRenderer } = require('electron');
ipcRenderer.on('podman-event', (event, data) => {
console.log('Podman event received:', data);
});
Rancher Desktop (TypeScript):
import { ipcRenderer } from 'electron';
ipcRenderer.on('docker-event', (event: Electron.IpcRendererEvent, data: any) => {
console.log('Docker event received:', data);
});
Both projects use Electron for their desktop applications, with similar event handling patterns. The main difference lies in the specific events and APIs they interact with (Podman vs. Docker).
Podman Desktop focuses on providing a flexible container management solution with support for multiple engines, while Rancher Desktop offers a more integrated experience with Kubernetes and cloud services. The choice between the two depends on specific use cases and preferences for container technologies.
Container runtimes on macOS (and Linux) with minimal setup
Pros of Colima
- Lightweight and minimal resource usage
- Supports both Docker and Kubernetes
- Easy to install and use via Homebrew
Cons of Colima
- Limited to macOS and Linux platforms
- Fewer features and customization options
- Smaller community and less frequent updates
Code Comparison
Colima:
colima start
colima stop
colima delete
Rancher Desktop:
rd start
rd stop
rd delete
Both projects aim to provide local Docker and Kubernetes environments, but they differ in their approach and target audience. Rancher Desktop offers a more comprehensive solution with a graphical user interface and broader platform support, including Windows. It's designed to be a full-featured alternative to Docker Desktop.
Colima, on the other hand, focuses on simplicity and minimal resource usage, making it an excellent choice for developers who prefer a lightweight, command-line-based solution on macOS and Linux.
While Rancher Desktop provides more extensive features and customization options, Colima excels in its simplicity and ease of use. The choice between the two depends on the user's specific needs, preferred workflow, and platform requirements.
Run Kubernetes locally
Pros of Minikube
- Mature project with extensive documentation and community support
- Supports multiple hypervisors and container runtimes
- Offers advanced features like multi-node clusters and custom addons
Cons of Minikube
- Requires manual installation of dependencies (e.g., hypervisor, kubectl)
- Can be resource-intensive, especially for older or less powerful machines
- Limited cross-platform consistency in user experience
Code Comparison
Minikube:
minikube start
minikube dashboard
kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.10
kubectl expose deployment hello-minikube --type=NodePort --port=8080
Rancher Desktop:
# No specific CLI commands required for basic setup
# Uses built-in UI for cluster management and deployment
Rancher Desktop provides a more streamlined, GUI-focused approach, while Minikube offers greater flexibility through its CLI. Rancher Desktop aims for a consistent cross-platform experience, whereas Minikube's setup process may vary depending on the host system and chosen hypervisor.
Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
Pros of DevPod
- Supports multiple cloud providers and local environments, offering greater flexibility
- Provides a CLI tool for easier management and automation of development environments
- Offers seamless integration with VS Code and other IDEs
Cons of DevPod
- Less mature project with potentially fewer community resources
- May require more manual configuration for complex setups
Code Comparison
DevPod configuration example:
images:
- name: golang
image: golang:1.16
shell: /bin/bash
env:
- GOPATH=/go
Rancher Desktop doesn't have a direct equivalent, as it focuses on providing a local Kubernetes environment rather than defining development environments.
Additional Notes
Rancher Desktop is primarily focused on providing a local Kubernetes environment with container management, while DevPod is designed to create and manage development environments across various platforms. Rancher Desktop offers a more user-friendly GUI for managing containers and Kubernetes clusters, making it potentially easier for beginners to get started.
DevPod's flexibility in supporting multiple cloud providers and local environments may be advantageous for teams working across different platforms or with varying infrastructure requirements. However, Rancher Desktop's tight integration with Kubernetes and container management tools might be more suitable for teams primarily focused on container-based development and deployment.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Rancher Desktop
Rancher Desktop is an open-source project that brings Kubernetes and container management to the desktop. It runs on Windows, macOS and Linux. This README pertains to the development of Rancher Desktop. For user-oriented information about Rancher Desktop, please see rancherdesktop.io. For user-oriented documentation, please see docs.rancherdesktop.io.
Overview
Rancher Desktop is an Electron application that is mainly written in TypeScript.
It bundles a variety of other technologies in order to provide one cohesive application.
It includes a command line tool, rdctl
, which is written in Go.
Most developer activities, such as running a development build, building/packaging
Rancher Desktop, running unit tests, and running end-to-end tests, are done through
yarn
scripts. Some exceptions exist, such as running BATS tests.
Setup
Windows
There are two options for building from source on Windows: with a Development VM Setup or Manual Development Environment Setup with an existing Windows installation.
Development VM Setup
-
Download a Microsoft Windows 10 development virtual machine. All of the following steps should be done in that virtual machine.
-
Open a PowerShell prompt (hit Windows Key +
X
and openWindows PowerShell
). -
Run the automated setup script:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser iwr -useb 'https://github.com/rancher-sandbox/rancher-desktop/raw/main/scripts/windows-setup.ps1' | iex
-
Close the privileged PowerShell prompt.
-
Ensure
msbuild_path
andmsvs_version
are configured correctly in.npmrc
file. Run the following commands to set these properties:npm config set msvs_version <visual-studio-version-number> npm config set msbuild_path <path/to/MSBuild.exe>
For example for Visual Studio 2022:
npm config set msvs_version 2022 npm config set msbuild_path "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe"
If you get an error message when trying to run
npm config set...
, runnpm config edit
and then add lines likemsvs_version=2022 msbuild_path=C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
Do not quote the values to the right side of the equal sign. The quotes aren't needed, and it's possible that some processors will treat them as literal parts of the path, and then fail.
-
Configure
git
to work with linux- and macos-originated files:git config --global --replace-all core.autocrlf false git config --global --replace-all core.eol lf
If you find the lint:go
tests are failing mysteriously, it's possible that the line-endings are incorrect.
You can now clone the repository and run yarn
.
Manual Development Environment Setup
- Install Windows Subsystem for Linux (WSL) on your machine. Skip this step, if WSL is already installed.
- Open a PowerShell prompt (hit Windows Key +
X
and openWindows PowerShell
). - Install Scoop via
iwr -useb get.scoop.sh | iex
. - Install 7zip, git, go, mingw, nvm, and unzip via
scoop install 7zip git go mingw nvm python unzip
. Check node version withnvm list
. If node v18 is not installed or set as the current version, then install usingnvm install 18
and set as current usingnvm use 18.xx.xx
. - Install the yarn package manager via
npm install --global yarn
- Install Visual Studio 2017 or higher. As of this writing the latest version is available at [https://visualstudio.microsoft.com/downloads/]; if that's changed, a good search engine should find it.
- Make sure you have the
Windows SDK
component installed. This Visual Studio docs describes steps to install components. The Desktop development with C++ workload needs to be selected, too. - Configure
git
to work with linux- and macos-originated files:git config --global --replace-all core.autocrlf false git config --global --replace-all core.eol lf
If you find the lint:go
tests are failing mysteriously, it's possible that the line-endings are incorrect.
9. Ensure msbuild_path
and msvs_version
are configured correctly in .npmrc
file. Run the following commands to set these properties:
npm config set msvs_version <visual-studio-version-number>
npm config set msbuild_path <path/to/MSBuild.exe>
For example for Visual Studio 2022:
npm config set msvs_version 2022
npm config set msbuild_path "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe"
If you get an error message when trying to run npm config set...
, run npm config edit
and then add lines like
msvs_version=2022
msbuild_path=C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
Do not quote the values to the right side of the equal sign. They aren't needed, and it's possible that some processor will treat them as literal parts of the path, and then fail.
You can now clone the repository and run yarn
.
macOS
Install nvm
to get Node.js and npm:
See https://github.com/nvm-sh/nvm#installing-and-updating and run the curl
or wget
command to install nvm.
Note that this script adds code dealing with nvm
to a profile file
(like ~/.bash_profile
). To add access to nvm
to a current shell session,
you'll need to source
that file.
Currently we build Rancher Desktop with Node 18. To install it, run:
nvm install 18.18
Next, you'll need to install the yarn package manager:
npm install --global yarn
You'll also need to run brew install go
if you haven't installed go.
Then you can install dependencies with:
yarn
â ï¸ Working on a mac with an M1 chip?
You will need to set the
M1
environment variable before installing dependencies and running any npm scripts:export M1=1 yarn
You will want to run
git clean -fdx
to clean out any cached assets and re-downloaded with the correct arch before runningyarn
if you previously installed dependencies without settingM1
first.
Linux
Ensure you have the following installed:
-
Node.js v18. Make sure you have any development packages installed. For example, on openSUSE Leap 15.3 you would need to install
nodejs18
andnodejs18-devel
. -
Go 1.21 or later.
-
Dependencies described in the
node-gyp
docs installation. This is required to install theffi-napi
npm package. These docs mention "a proper C/C++ compiler toolchain". You can installgcc
andg++
for this.
Then you can install dependencies with:
yarn
You can then run Rancher Desktop as described below. It may fail on the first run - if this happens, try doing a factory reset and re-running, which has been known to solve this issue.
Running
Once you have your dependencies installed you can run a development version of Rancher Desktop with:
yarn dev
Tests
To run the unit tests:
yarn test
To run the integration tests:
yarn test:e2e
Building
Rancher can be built from source on Windows, macOS or Linux. Cross-compilation is currently not supported. To run a build do:
yarn build
yarn package
The build output goes to dist/
.
Debugging builds with the Chrome remote debugger
The Chrome remote debugger allows you to debug Electron apps using Chrome Developer Tools. You can use it to access log messages that might output to the developer console of the renderer process. This is especially helpful for getting additional debug information in production builds of Rancher Desktop.
Starting Rancher Desktop with Remote Debugging Enabled
To enable remote debugging, start Rancher Desktop with the --remote-debugging-port
argument.
On Linux, start Rancher Desktop with the following command:
rancher-desktop --remote-debugging-port="8315" --remote-allow-origins=http://localhost:8315
On macOS, start Rancher Desktop with the following command:
/Applications/Rancher\ Desktop.app/Contents/MacOS/Rancher\ Desktop --remote-debugging-port="8315" --remote-allow-origins=http://localhost:8315
On Windows, start Rancher Desktop with the following command:
cd 'C:\Program Files\Rancher Desktop\'
& '.\Rancher Desktop.exe' --remote-debugging-port="8315" --remote-allow-origins=http://localhost:8315
After Rancher Desktop starts, open Chrome and navigate to http://localhost:8315/
. Select the available target to start remote debugging Rancher Desktop.
Remote Debugging an Extension
To remote debug an extension, follow the same process as remote debugging a build. However, you will need to load an extension before navigating to http://localhost:8315/
. Both Rancher Desktop and the loaded extension should be listed as available targets.
Debugging dev env with GoLand
The following steps have been tested with GoLand on Linux but might work for other JetBrains IDEs in a similar way.
-
Install the Node.js plugin (via
File > Settings > Plugins
) -
Go to the "Run/Debug Configurations" dialog (via
Run > Edit Configurations...
) -
Add a new Node.js configuration with the following settings:
- Name: a name for the debug configuration, e.g.
rancher desktop
- Node interpreter: choose your installed node interpreter, e.g.
/usr/bin/node
- Node parameters:
scripts/ts-wrapper.js scripts/dev.ts
- Working directory: choose the working directory of your project, e.g.
~/src/rancher-desktop
- Name: a name for the debug configuration, e.g.
-
Save the configuration
-
You can now set a breakpoint and click "Debug 'rancher desktop'" to start debugging
Development Builds
Windows and macOS
Each commit triggers a GitHub Actions run that results in application bundles
(.exe
s and .dmg
s) being uploaded as artifacts. This can be useful if you
want to test the latest build of Rancher Desktop as built by the build system.
You can download these artifacts from the Summary page of completed package
actions.
Linux
Similar to Windows and macOS, Linux builds of Rancher Desktop are made from each commit. However on Linux, only part of the process is done by GitHub Actions. The final part of it is done by Open Build Service.
There are two channels of the Rancher Desktop repositories: dev
and stable
.
stable
is the channel that most users use. It is the one that users are
instructed to add in the official documentation, and the one that contains
builds that are created from official releases. dev
is the channel that we are
interested in here: it contains builds created from the latest commit made on
the main
branch, and on any branches that match the format release-*
. To
learn how to install the development repositories, see below.
When using the dev
repositories, it is important to understand the format of
the versions of Rancher Desktop available from the dev
repositories.
The versions are in the format:
<priority>.<branch>.<commit_time>.<commit>
where:
priority
is a meaningless number that exists to give versions built from the main
branch priority over versions built from the release-*
branches when updating.
branch
is the branch name; dashes are removed due to constraints imposed by
package formats.
commit_time
is the UNIX timestamp of the commit used to make the build.
commit
is the shortened hash of the commit used to make the build.
.deb
Development Repository
You can add the repo with the following steps:
curl -s https://download.opensuse.org/repositories/isv:/Rancher:/dev/deb/Release.key | gpg --dearmor | sudo dd status=none of=/usr/share/keyrings/isv-rancher-dev-archive-keyring.gpg
echo 'deb [signed-by=/usr/share/keyrings/isv-rancher-dev-archive-keyring.gpg] https://download.opensuse.org/repositories/isv:/Rancher:/dev/deb/ ./' | sudo dd status=none of=/etc/apt/sources.list.d/isv-rancher-dev.list
sudo apt update
You can see available versions with:
apt list -a rancher-desktop
Once you find the version you want to install you can install it with:
sudo apt install rancher-desktop=<version>
This works even if you already have a version of Rancher Desktop installed.
.rpm
Development Repository
You can add the repo with:
sudo zypper addrepo https://download.opensuse.org/repositories/isv:/Rancher:/dev/rpm/isv:Rancher:dev.repo
sudo zypper refresh
You can see available versions with:
zypper search -s rancher-desktop
Finally, install the version you want with:
zypper install --oldpackage rancher-desktop=<version>
This works even if you already have a version of Rancher Desktop installed.
Development AppImages
There are no repositories for AppImages, but you can access the latest development AppImage builds here.
API
Rancher Desktop supports a limited HTTP-based API. The API is defined in
pkg/rancher-desktop/assets/specs/command-api.yaml
, and you can see examples of how it's
invoked in the client code at go/src/rdctl
.
Stability
The API is currently at version 1, but is still considered internal and experimental, and is subject to change without any advance notice. At some point we expect that necessary changes to the API will go through a warning and deprecation notice.
Contributing
Please see the document about contributing.
Further Reading
Please see the docs directory for further developer documentation.
Top Related Projects
Linux virtual machines, with a focus on running containers
Podman Desktop - A graphical tool for developing on containers and Kubernetes
Container runtimes on macOS (and Linux) with minimal setup
Run Kubernetes locally
Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot