Using Okteto as a Developer
Introduction
Welcome to the Okteto Quick Start Guide! This guide will help you, as a developer, get started with Okteto in a few steps. Once your platform team has set up Okteto and configured your account, you can follow this guide to deploy your Development Environments and start coding in no time.
Step 1: Sign In to Okteto
- Open your web browser and navigate to your Okteto instance URL. It should look something like
https://okteto.example.com
- Sign in using the authentication method configured by your organization (e.g., GitHub, SSO).
Step 2: Explore Your Namespace
- After logging in, you will see your personal Namespace. This Namespace is automatically created by Okteto and is named after your account name or email.
- Namespaces in Okteto are used to deploy your Development Environments. You can create as many Namespaces as you need by clicking on the “New Namespace” button that appears when you click on the Namespace dropdown in the top left corner.
Step 3: Deploy a Development Environment
- Click the Deploy Dev Environment button in the Okteto UI.
- The Okteto Catalog will appear. This catalog contains a list of preconfigured applications provided by your organization’s platform team. A dev environment in Okteto is a version of your application deployed to a Namespace which syncs your local code with the code running on the cloud.
- From the Okteto Catalog, select the application you want to develop. Okteto will begin deploying the chosen application.
- Once the application is deployed, your dev environment is ready. Okteto will create endpoints for all the microservices and external resources (if configured by the platform team) as part of your application and give you the links view them.
Step 4: Install the Okteto CLI
The Okteto CLI is our open-source tool that let's you develop your applications on Okteto.
Installing the Okteto CLI
MacOS / Linux
curl https://get.okteto.com -sSfL | sh
If you need a specific version you can set the OKTETO_VERSION environment variable:
curl https://get.okteto.com -sSfL | OKTETO_VERSION=2.31.0 sh
You can also install it via brew by running:
brew install okteto
Windows
Download https://downloads.okteto.com/cli/stable/okteto.exe and add it to your $PATH
.
You can also install it via scoop by running:
scoop install okteto
For updating okteto with scoop, you might need to scoop unhold okteto & scoop update okteto
or scoop uninstall okteto & scoop install okteto
Step 5: Configure the Okteto CLI
The first thing you need to do before using the Okteto CLI is to set the Okteto CLI context with your Okteto instance. Open a terminal and point the Okteto CLI to your Okteto instance by running:
okteto context
And then typing in the URL for your Okteto instance when prompted.
You’ll be taken to the browser and asked to authenticate. Once that is done, Okteto CLI is configured and ready to be used with your development environments.
Step 6: Start Your Development Container
-
Clone the repository of the application you deployed in step 3 to your local machine.
-
Open the cloned repository in your favorite code editor (Okteto supports any code editor and other tools you prefer).
-
In the terminal, navigate to the application’s directory.
-
Start the development container by running:
okteto up
-
You will be prompted to select the microservice you want to work on. Choose the appropriate service to proceed.
-
If you need to work on multiple services simultaneously, you can launch another
okteto up
session in a different terminal window.
Step 7: Begin Development
-
Once the development container is up, you will have terminal access inside of the dev container.
-
Start the development process by executing the appropriate command for your application. For instance, if you're working on the frontend service of a React-based application:
yarn start
Step 8: Sync Code and View Changes
- The dev container syncs all your local code changes with the code running on the cloud cluster.
- Any changes you make locally will be reflected in the endpoints shown in the Okteto UI, allowing you to see your changes in a production-like environment instantly.
Benefits of Using Okteto
- No Configuration Required: You can start writing code immediately using the pre-configured applications in the Okteto catalog.
- Resource Efficiency: You are not limited by your local machine’s resources when running resource-intensive services and applications.
- Immediate Feedback: You can see your changes running in a production-like environment as soon as you write code, without waiting for CI, staging, or test environments.
Next Steps
Dive into learning about Okteto by following our CLI and Dashboard guide here.
Happy coding!