$npx -y skills add tikoci/routeros-skills --skill routeros-app-yamlRouterOS /app YAML format for container applications (7.21+ builtin app, 7.22+ custom YAML creation). Use when: writing or validating RouterOS /app YAML files, working with MikroTik container apps, building docker-compose-like definitions for RouterOS, creating /app store schemas
| 1 | # RouterOS /app YAML Format (7.21+) |
| 2 | |
| 3 | RouterOS 7.21 introduced the `/app` path (built-in app listing and management). The full YAML app creation feature (`/app/add`) appeared in **7.22** (first seen in 7.22beta5). Think of it as MikroTik's opinionated alternative to `docker-compose` — but it is NOT docker-compose, with significant differences. |
| 4 | |
| 5 | ## What /app Is |
| 6 | |
| 7 | The `/app` subsystem lets users define one or more containers as a single "application" in YAML. RouterOS parses the YAML, creates containers, volumes, networks, and config files, then manages the lifecycle. |
| 8 | |
| 9 | **Key concepts:** |
| 10 | |
| 11 | - Each `/app` is defined by a YAML document with services, configs, volumes, and networks |
| 12 | - The YAML is loaded into RouterOS via CLI (`/app/add yaml-url=...`) or REST API |
| 13 | - Built-in apps ship with RouterOS (visible at `GET /rest/app`) |
| 14 | - Custom apps can be added from URLs or inline YAML |
| 15 | - App stores (`app-store-urls=`) provide curated collections |
| 16 | |
| 17 | ## Critical Differences from docker-compose |
| 18 | |
| 19 | | Feature | docker-compose | RouterOS /app | |
| 20 | |---|---|---| |
| 21 | | Port format | `host:container[/protocol]` | Two styles (see below) | |
| 22 | | Environment | `KEY=value` or list | Same, but placeholders expand | |
| 23 | | Volumes | Named or bind mounts | Subset — no bind mount options | |
| 24 | | Networks | Full docker network model | Simplified — name + external | |
| 25 | | Build | Full Dockerfile support | Minimal (context + dockerfile) | |
| 26 | | Configs | Docker configs API | Inline `content` only | |
| 27 | | Deploy/resources | Yes | No — not supported | |
| 28 | | Top-level `version:` | Deprecated (was required) | Not used | |
| 29 | | File extension | `.yml` / `.yaml` | `.tikapp.yaml` (convention) | |
| 30 | |
| 31 | ## Top-Level Properties |
| 32 | |
| 33 | | Property | Type | Required | Description | |
| 34 | |---|---|---|---| |
| 35 | | `name` | string | No | Unique identifier for the /app | |
| 36 | | `descr` | string | No | Human-readable description shown in app UI | |
| 37 | | `page` | string (URI) | No | Project homepage URL | |
| 38 | | `category` | string (enum) | No | App store classification | |
| 39 | | `icon` | string (URI) | No | Icon URL (shown in WebFig with `show-in-webfig=yes`) | |
| 40 | | `default-credentials` | string or null | No | `username:password` shown in UI | |
| 41 | | `url-path` | string | No | URL path suffix for browser access (e.g., `/admin`) | |
| 42 | | `credentials` | string | No | Credential hint (alternative to default-credentials) | |
| 43 | | `option` | boolean | No | Whether app is optional | |
| 44 | | `auto-update` | boolean | No | Pull and restart containers on every boot | |
| 45 | | `services` | object | **Yes** | Container service definitions (≥1 required) | |
| 46 | | `volumes` | object | No | Named volume declarations | |
| 47 | | `networks` | object | No | Network declarations | |
| 48 | | `configs` | object | No | Config file declarations with inline content | |
| 49 | |
| 50 | ### Category Values (Exhaustive) |
| 51 | |
| 52 | ```text |
| 53 | productivity, storage, networking, development, communication, |
| 54 | file-management, search, video, media, media-management, |
| 55 | home-automation, monitoring, database, automation, ai, |
| 56 | messaging, radio, security, business |
| 57 | ``` |
| 58 | |
| 59 | New categories appear when MikroTik adds built-in apps. The CI schema validation catches these. |
| 60 | |
| 61 | ## Service Properties |
| 62 | |
| 63 | Each key under `services:` defines one container. Required property: `image`. |
| 64 | |
| 65 | | Property | Type | Description | |
| 66 | |---|---|---| |
| 67 | | `image` | string | Container image (omit registry to use `/container/config`'s `registry-url`) | |
| 68 | | `container_name` | string | Explicit name; used as base for file paths under `/container` | |
| 69 | | `hostname` | string | Container hostname | |
| 70 | | `entrypoint` | string or string[] | Override default entrypoint | |
| 71 | | `command` | string or string[] | Override default command | |
| 72 | | `ports` | array | Port mappings (see format section) | |
| 73 | | `environment` | object or array or null | Environment variables (`KEY=value` list or `{KEY: value}` map) | |
| 74 | | `volumes` | array of strings | Volume mounts (e.g., `my-vol:/data`) | |
| 75 | | `configs` | array of objects | Config file placements (`{source, target, mode}`) | |
| 76 | | `restart` | enum | `no`, `always`, `on-failure`, `unless-stopped` | |
| 77 | | `depends_on` | array or object | Service dependency ordering | |
| 78 | | `devices` | array of strings | Device mappings passed to container | |
| 79 | | `user` | string | User to run container as | |
| 80 | | `security_opt` | array of strings | Security options | |
| 81 | | `shm_size` | string | Shared memory size | |
| 82 | | `stop_grace_period` | string or int | Time before SIGKILL | |
| 83 | | `ulimits` | object | Resource limits (e.g., `nofile: {soft: 65536, hard: 65536}`) | |
| 84 | | `build` | object or string | Build configuration (context, dockerfile, args) | |
| 85 | | `healthcheck` | object | Health check (test, interval, timeout, retries, start_period) |