Skip to main content
Version: 1.14

Docker Compose on Kubernetes with Okteto

This tutorial will show you how to develop an application with Okteto using Docker Compose files. Docker Compose are for developers who don't want to deal with the complexities of Kubernetes manifests. Okteto implements and extends the Compose Specification to make it easy to develop Docker Compose applications on Kubernetes.


Step 1: Launch your Development Environment

Get a local version of the Sample App by executing the following commands:

$ git clone
$ cd compose-getting-started

The Sample App is a simple web application implemented using Python, with Redis for storage. The docker-compose.yml file defines the components of the Sample App:

build: vote
scale: 2
- FLASK_ENV=development
command: python
- 8080:8080
- ./vote:/src

image: redis
- 6379
- redis:/data


The equivalent Kubernetes manifests would have more than 300 lines of yaml!

Deploying the Sample App is as simple as executing this command:

$ okteto deploy --wait
 i  Using cindylopez @ as context
✓ Deploying compose
i Endpoints available:
✓ Development environment 'compose-getting-started' successfully deployed
i Run 'okteto up' to activate your development container

The deploy command will create the necessary deployments, services, persistent volumes, and ingress rules needed to run the Sample App. Cool no 😎?

Open your browser and go to the URL of your development environment, shown as part of the okteto deploy logs ( in this case).

Step 2: Developing time!

In order to hot-reload your application in your remote development environment, run the this command:

$ okteto up vote
 i  Using cindylopez @ as context
i Development environment 'compose-getting-started' already deployed.
i To redeploy your development environment run 'okteto deploy' or 'okteto up vote --deploy'
✓ Persistent volume successfully attached
✓ Images successfully pulled
✓ Files synchronized
Namespace: cindylopez
Name: vote
Forward: 8080 -> 8080

* Serving Flask app 'app' (lazy loading)
* Environment: development
* Debug mode: on
* Running on all addresses.
WARNING: This is a development server. Do not use it in a production deployment.
* Running on (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 838-277-059

From this moment, all you code changes will be immediatelly synched and hot-reloaded by your development environment. For example, open the vote/ file in your IDE and modify the voting options on lines 16-17.

def getOptions():
option_a = "Local development"
option_b = "Cloud development"

Save your changes. Check the output of your development environment:

 * Detected change in '/src/', reloading
* Restarting with stat
* Debugger is active!
* Debugger PIN: 838-277-059

Access the URL of your application again. Your code changes were instantly applied. No commit, build, or push required!

Next steps

Congratulations, you just developed your first application with Okteto 🚀.

Read the docs for the Docker Compose and the available Okteto CLI commands to learn more about developing your Docker Compose application on Okteto.

Head over to our getting started guides for Go, ASP.NET, Java, Node.js, PHP, Python, or Ruby to see how to configure Okteto to live-update your application with different programming languages and debuggers.