---
sidebar_position: -18.0
sidebar_label: v0.18.0
---
# v0.18.0
This page mirrors the [GitHub release](https://github.com/psviderski/uncloud/releases/tag/v0.18.0), which also includes
the full list of commits.
The main highlights of this release are **pre-deploy hooks** for running database migrations and a **redesigned deployment plan** output that makes `uc deploy` much nicer to read and understand.
On top of that, 0.18.0 also:
- makes the system `ssh` CLI the default connection method (with fallback to the Go implementation)
- adds Compose support for `pid`, `shm_size`, and the new `x-context` extension to pin a Compose file to a cluster
- brings new docs, a bunch of quality-of-life improvements and bug fixes, read on for the full details!
## Pre-deploy hooks
⚠️ This requires both `uc` and the daemon to be [upgraded to v0.18.0](#upgrade-to-0180)
Changes: [f4581ea](https://github.com/psviderski/uncloud/commit/f4581eac1167979e9297d749cb8ac8aa56a1cecc), [1c8b770](https://github.com/psviderski/uncloud/commit/1c8b770), [772b31b](https://github.com/psviderski/uncloud/commit/772b31b), [0e820f9](https://github.com/psviderski/uncloud/commit/0e820f9)
You can now run a one-off command before deploying a service using the new `x-pre_deploy` Compose extension. This is ideal for database schema migrations, uploading static assets to a CDN, cache invalidation, and any other setup task that needs to run **once** before new code goes live.
```yaml title="compose.yaml"
services:
web:
build: ..
environment:
DATABASE_URL: postgres://postgres:${DB_PASSWORD}@db:5432/postgres
x-pre_deploy:
# Apply Django migrations from the built image before deploying new app containers.
command: python manage.py migrate
depends_on:
- db
```
Here is how it's displayed in the deploy plan when you run `uc deploy`:
The hook command runs in a new container that inherits the service's image, environment variables, volumes, placement, and compute resources.
If the command exits successfully, the deployment continues with a normal rolling update. If it fails or times out, the deployment stops immediately and `uc deploy` displays the latest hook logs to help you diagnose the issue.

Container tables in `uc ps` and `uc inspect` now also list pre-deploy hook containers.
See the docs:
- [Pre-deploy hooks](/docs/guides/deployments/pre-deploy-hooks) guide for more details and examples
- [`x-pre_deploy`](/docs/compose-file-reference/extensions#x-pre_deploy) reference for all available attributes
## Restyled deployment plans
Changes: [0f4c211](https://github.com/psviderski/uncloud/commit/0f4c211), [f5a77b8](https://github.com/psviderski/uncloud/commit/f5a77b8), [b4b1232](https://github.com/psviderski/uncloud/commit/b4b1232)
The deployment plan output that you see when running `uc deploy`, `uc scale`, and `uc caddy deploy` has been redesigned with consistent styling, clearer operation verbs, and a header and the prompt showing the target context.
We hope this makes it easier for you to understand what changes will be made and to which cluster before you confirm the deployment.
## System `ssh` is now the default connection method
Change: [06c2bc5](https://github.com/psviderski/uncloud/commit/06c2bc55f2fbf20920613aac45c07952107160a0)
The `ssh+cli://` connection method that uses your system's `ssh` CLI is now the default for new connections, so the prefix can be omitted:
```shell
# Old
uc machine init ssh+cli://user@host
# New
uc machine init user@host
```
`ssh_cli:` can also be replaced with just `ssh:` in the config file (`~/.config/uncloud/config.yaml`):
```yaml title="config.yaml"
contexts:
prod:
connections:
- ssh: user@host
```
This will by default use your existing SSH config, agent, keys, `ProxyJump`, and `ProxyCommand` setup automatically. You can fall back to the Go native SSH implementation using `ssh+go://` prefix.
Combined with the SSH control socket reuse introduced in [v0.17.0](https://github.com/psviderski/uncloud/releases/tag/v0.17.0), this makes most `uc` commands noticeably faster and removes a whole class of authentication friction.
The new [Connecting to a cluster](/docs/concepts/clusters/connecting) doc walks through all the supported connection schemes (`ssh://`, `ssh+go://`, `tcp://`, `unix://`), how `uc` picks a machine to talk to from your config, and how to connect without a config file for CI pipelines and scripts.
## Cluster context selection in Compose
Change: [1525d18](https://github.com/psviderski/uncloud/commit/1525d182b516b876510d6e4413ca2fe9ff029b53)
You can now pin a Compose file to a specific context using the new `x-context` extension. This prevents accidentally deploying to the wrong cluster when you switch contexts.
```yaml title="compose.yaml"
x-context: prod
services:
web:
image: myapp
```
When `x-context` is set, `uc deploy` will use that context regardless of your currently selected one in the Uncloud config. The deployment plan output also displays the target context so you always know where your changes are going.
See [`x-context`](/docs/compose-file-reference/extensions#x-context) reference for more details.
## Compose `pid` namespace support
PR: [#276](https://github.com/psviderski/uncloud/pull/276). Thanks to [@miekg](https://github.com/miekg) for the contribution ❤️
You can now configure the [PID namespace mode](https://github.com/compose-spec/compose-spec/blob/main/spec.md#pid) for service containers. The most common use case is `pid: host`, which lets a container see and interact with processes on the host. This is useful for monitoring agents, debuggers, and similar tooling.
```yaml
services:
monitoring:
image: agent
pid: host
```
## Compose `shm_size` support
Change: [8ae38cf](https://github.com/psviderski/uncloud/commit/8ae38cfd57d02f42631e0c2bb54c4331b9c072c9)
You can now set [`shm_size`](https://github.com/compose-spec/compose-spec/blob/main/spec.md#shm_size), the size of the `/dev/shm` shared memory tmpfs. This is useful for databases like Postgres, headless Chromium, and other workloads that need a larger shared memory segment.
```yaml
services:
postgres:
image: postgres:18
shm_size: 256mb
```
## Documentation
- [Connecting to a cluster](/docs/concepts/clusters/connecting): a complete guide to cluster contexts, connection resolution and all supported types, and how to connect without a config file
- [CLI configuration file](/docs/cli-config-reference): a full reference for the `~/.config/uncloud/config.yaml` file, covering contexts, connections, and all supported fields
- [Pre-deploy hooks](/docs/guides/deployments/pre-deploy-hooks): a guide for the new feature, with examples for database migrations and other one-off setup tasks
- [Compose extensions](/docs/compose-file-reference/extensions): a dedicated reference page for all Uncloud-specific Compose extensions
## Improvements
- The `uc` CLI and the daemon now exchange versions on every gRPC call and error if they are incompatible. This is a groundwork to make better user experience when releasing breaking changes in the future ([#260](https://github.com/psviderski/uncloud/pull/260)). Thanks to [@jabr](https://github.com/jabr) for the contribution ❤️
- New `uc exec` accepts an optional `--` separator before the command, matching Docker and other CLIs ([#301](https://github.com/psviderski/uncloud/pull/301)). Thanks to [@nick-potts](https://github.com/nick-potts) for the contribution ❤️
- New `uc docs --manual` flag generates manual pages for `uc`, making it easier for distribution maintainers to package manpages alongside the binary ([#302](https://github.com/psviderski/uncloud/pull/302)). Thanks to [@miekg](https://github.com/miekg) for the contribution ❤️
- The daemon now exposes a gRPC method to fetch journald logs from a machine, laying the groundwork for an upcoming `uc machine logs` command ([#282](https://github.com/psviderski/uncloud/pull/282)). Thanks to [@miekg](https://github.com/miekg) for the contribution ❤️
- Warnings are now printed for detected unsupported Compose features ([#288](https://github.com/psviderski/uncloud/pull/288)). Thanks to [@miekg](https://github.com/miekg) for the contribution ❤️
- New `--auto-confirm` flag for `uc scale` which now always asks for confirmation before changing replica counts
- New `--ulimit` flag for `uc run` to set resource limits
- bumped Go to 1.26.1 and modernized the codebase using Go 1.26 ([#278](https://github.com/psviderski/uncloud/pull/278))
- Migrated TUI components to `lipgloss/v2`, `bubbletea/v2`, and `huh/v2`
## Bug fixes
- Fixed `uc deploy` crash in an initialised but empty git repository ([#275](https://github.com/psviderski/uncloud/pull/275)). Thanks to [@tonyo](https://github.com/tonyo) for the contribution ❤️
- Fixed `ucind` downloading the wrong Corrosion architecture on arm64 ([#285](https://github.com/psviderski/uncloud/pull/285)). Thanks to [@miekg](https://github.com/miekg) for the contribution ❤️
- Fixed output contamination in the SSH CLI executor by separating stdout and stderr ([#270](https://github.com/psviderski/uncloud/issues/270))
- Fixed trying other machine connections when the first one fails for the new default `ssh` type. Fixed the TUI progress spinner.
## Upgrade to 0.18.0
### Uncloud CLI locally
To upgrade the Uncloud CLI (`uc`) locally:
```bash
# Homebrew (macOS, Linux)
brew upgrade uncloud
# Install script (macOS, Linux)
curl -fsS https://get.uncloud.run/install.sh | sh
```
### Machine daemon
To upgrade the Uncloud daemon on your machines, run the following commands on each machine:
```bash
# AMD64
curl -fsSL -o uncloudd.tar.gz https://github.com/psviderski/uncloud/releases/download/v0.18.0/uncloudd_linux_amd64.tar.gz
# ARM64
# curl -fsSL -o uncloudd.tar.gz https://github.com/psviderski/uncloud/releases/download/v0.18.0/uncloudd_linux_arm64.tar.gz
tar -xf uncloudd.tar.gz
sudo install uncloudd /usr/local/bin/uncloudd
rm uncloudd uncloudd.tar.gz
sudo systemctl restart uncloud
```