Improve YAMS container customization documentation

This commit is contained in:
Roger Gonzalez 2024-12-26 10:55:21 -03:00
parent 9bd7d9f194
commit fe66243de5
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6

View File

@ -3,70 +3,126 @@ title: "Adding your own containers to YAMS"
date: 2023-10-21T21:41:29-03:00
draft: false
weight: 1
summary: Instructions on how to add your own Docker containers to YAMS.
summary: A complete guide to expanding YAMS with your own Docker containers
---
Adding your own containers in YAMS is very easy.
# Make YAMS Your Own! 🚀
First, go to your install location. For the purposes of this tutorial, I'll use `/opt/yams`.
Want to add more containers to your YAMS setup? Maybe a cool new app you found, or something specific for your needs? No problem! YAMS makes it super easy to expand your media server with custom containers.
## The Basics 📚
When you install YAMS, it creates two important files:
- `docker-compose.yaml`: This is YAMS's brain! Don't modify this file directly.
- `docker-compose.custom.yaml`: This is your playground! Add all your custom containers here.
## Getting Started 🎯
First, let's find your YAMS installation. I'll use `/opt/yams` in these examples, but replace it with your actual install location:
```bash
cd /opt/yams
```
If you `ls`, you'll see 2 files:
- `docker-compose.yaml`: This is YAMS. You shouldn't mess with this file manually.
- `docker-compose.custom.yaml`: Here's where you'll add your containers. Any container you add here will be automatically added to the YAMS network and will be able to communicate locally with YAMS.
## The Magic Variables ✨
To add your containers, you'll have a few environment variables available:
- `PUID`: Your PUID.
- `PGID`: Your PGID.
- `MEDIA_DIRECTORY`: Your media directory.
- `INSTALL_DIRECTORY`: Your install location.
# Adding a container
As an example, I'll add [Overseerr](https://overseerr.dev/).
Open `docker-compose.custom.yaml` and add the following information:
YAMS provides some handy environment variables you can use in your custom containers:
```yaml
version: "3"
PUID: Your user ID
PGID: Your group ID
MEDIA_DIRECTORY: Your media folder location
INSTALL_DIRECTORY: Your YAMS installation location
```
services: # -> Uncomment this line! (remove the "#" in front of it)
These make it super easy to keep your custom containers working in harmony with YAMS!
# Add your container here 👇
## Let's Add a Container! 🎮
Let's walk through an example by adding [Overseerr](https://overseerr.dev/) - a fantastic request management app for your media server.
1. First, open `docker-compose.custom.yaml`:
```bash
nano docker-compose.custom.yaml
```
2. If this is your first custom container, you'll need to uncomment the `services:` line. Your file should start like this:
```yaml
services: # Make sure this line is uncommented!
```
3. Now let's add Overseerr with all the YAMS goodies:
```yaml
overseerr:
image: lscr.io/linuxserver/overseerr:latest
container_name: overseerr
environment:
- PUID=${PUID} # Note how I'm using the env variables here
- PGID=${PGID} # Note how I'm using the env variables here
- PUID=${PUID} # Using YAMS's user ID
- PGID=${PGID} # Using YAMS's group ID
volumes:
- ${INSTALL_DIRECTORY}/config/overseer:/config # Note how I'm using the env variables here
- ${INSTALL_DIRECTORY}/config/overseer:/config # Using YAMS's config location
ports:
- 5055:5055
restart: unless-stopped
```
To start the container, run:
4. Time to start your new container:
```bash
yams restart
```
If everything is okay, you should see Overseer installing:
You should see something like:
```bash
⠙ overseerr Pulling 5.2s
...
⠙ overseerr Pulling 5.2s
[...]
```
And that's it!
That's it! Your new container is up and running! 🎉
You can find new containers here:
- https://fleet.linuxserver.io/ (recommended).
- https://hub.docker.com/.
## Pro Tips 🎓
### 1. Container Discovery
Looking for cool containers to add? Check out:
- [linuxserver.io fleet](https://fleet.linuxserver.io/) (Highly recommended!)
- [Docker Hub](https://hub.docker.com/)
### 2. Network Magic 🌐
All containers in your `docker-compose.custom.yaml` automatically join YAMS's network! This means they can talk to each other using their container names as hostnames.
For example, if you need to connect to Radarr from a custom container, just use `http://radarr:7878` as the URL.
### 3. VPN Access 🔒
Want your custom container to use YAMS's VPN? Add this to your container config:
```yaml
network_mode: "service:gluetun"
```
Check out [Running Prowlarr behind the VPN](/advanced/prowlarr-behind-vpn) for a detailed example!
### 4. Variable Power 💪
You can access any environment variable from YAMS's `.env` file in your custom containers. Just use the `${VARIABLE_NAME}` syntax!
## Common Gotchas 🚨
1. **Container Names**: Make sure your custom container names don't conflict with YAMS's built-in containers.
2. **Port Conflicts**: Double-check that your new containers don't try to use ports that are already taken.
3. **Permissions**: If your container needs to access media files, remember to use `PUID` and `PGID`!
## Need Ideas? 💡
Here are some popular containers that work great with YAMS:
1. **[Overseerr](https://overseerr.dev/)** or **[Petio](https://petio.tv/)**: Let users request movies and shows
2. **[Tautulli](https://tautulli.com/)**: Advanced Plex monitoring and statistics
3. **[Organizr](https://organizr.app/)**: Create a sleek dashboard for all your services
## Need Help? 🆘
If you run into any issues:
1. Check our [Common Issues](/faqs/common-errors/) page
2. Visit the [YAMS Forum](https://forum.yams.media)
3. Join our [Discord](https://discord.gg/Gwae3tNMST) or [Matrix](https://matrix.to/#/#yams-space:rogs.me) chat
Remember: YAMS is all about making your media server work for YOU. Don't be afraid to experiment and make it your own! 😎