Yacht is a lightweight, web-based interface for managing Docker containers. It provides a simple and user-friendly way to handle Docker containers, images, volumes, and networks, making it easier for users who prefer a graphical interface over command-line operations.
Yacht makes Docker management accessible for users who may not be comfortable using the command line all the time. It simplifies tasks like deploying new containers or checking the status of running services with an easy-to-use interface. It’s especially helpful for beginners who want to explore Docker without diving into complex commands.
docker-compose.yml
FileCreate a directory for your Docker Compose setup, for example:
cd /src/
mkdir yacht
cd yacht
Inside this directory, create a file called docker-compose.yml
:
touch docker-compose.yml
Open the docker-compose.yml
file in a text editor, then add the following content:
version: '3.8'
services:
yacht:
image: selfhostedpro/yacht
container_name: yacht
ports:
- 8000:8000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/config
restart: unless-stopped
Here’s what each section means:
version: '3.8'
: The version of the Docker Compose file format.services:
: This is where we define the Yacht service.
image: selfhostedpro/yacht
: The Docker image for Yacht.container_name: yacht
: This gives the container the name “yacht”.ports: 8000:8000
: Exposes port 8000 of the container to port 8000 on your computer.volumes:
: Maps system resources to the container.
/var/run/docker.sock:/var/run/docker.sock
: Allows Yacht to communicate with Docker../config:/config
: Stores Yacht’s configuration on your local machine.restart: unless-stopped
: Automatically restarts the container unless stopped manually.Make sure you're in the same directory as your docker-compose.yml
file.
Run the following command to start Yacht using Docker Compose:
docker-compose up -d
up
: Starts the containers specified in the docker-compose.yml
.-d
: Runs the containers in the background (detached mode).Docker Compose will pull the Yacht image (if not already downloaded) and create the container.
Open a web browser.
Type the following in the address bar:
http://srvX.lab.npnog.org.np:8000
This opens the Yacht web interface.
admin
and password is pass
—change this in the settings).To pull a new Docker image through the Yacht interface:
nginx
).To run a new container from an image:
To stop the Yacht service, run:
docker-compose down
This will stop and remove the Yacht container, but it won’t remove the image or any persistent data in the ./config
folder.