--- title: How to use Docker Compose description: published: true date: 2023-06-26T13:38:49.025Z tags: docker, ubuntu, containerization, container, linux, server editor: markdown dateCreated: 2023-06-26T13:38:49.025Z --- # How to use Docker Compose Examples for using Docker Compose, specifically tested on Ubuntu 22.04. ## Prerequisites - Docker installed on your system - A user account with sudo privileges ## Examples Base docker-compose.yml file: ```bash version: "3" services: : image: container_name: restart: ports: - ":" volumes: - : environment: - = ``` Nginx docker-compose.yml example: ```bash version: "3" services: nginx: image: nginx:latest container_name: nginx restart: always ports: - "80:80" volumes: - /home/nginx:/var/www/html environment: - TZ=Europe/London ```