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 pre-configured 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.
Follow the Okteto CLI installation steps before continuing this guide.
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 (replace https://okteto.example.com
with your Okteto instance URL):
okteto context use https://okteto.example.com
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 Development Container.
-
From the terminal, execute the appropriate command to start your application. For instance, if you're working on the frontend service of a React-based application:
yarn start
Step 8: Sync Code, Debug and View Changes
- The Development Container syncs all your local code changes with your application running on Okteto.
- Your code is executing in Okteto, but you can debug it and add breakpoints from your favorite IDE without any extra tools
- 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!