# tmux_server:stop_owned/1

- **Package:** libtmux_erlang
- **Language:** Erlang
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-erlang/blob/d1b6308440cf9eb8f6647e7ae434bce60e849368/apps/libtmux_erlang/src/tmux_server.erl#L163
- **Page:** https://libtmux.org/en/erlang/latest/reference/tmux_server-stop_owned-1/

```
stop_owned(Ownership)
-spec stop_owned(ownership()) -> ok | {error, map()}.
```

Stop the daemon and endpoint associated with a `t:ownership/0` token. Performs I/O and returns ok only after endpoint/client/helper retirement and namespace cleanup are proved. It never sends [kill-server](/en/tmux/latest/manual/kill-server/) to a socket path.

A replaced socket/directory or unexpected directory contents are preserved and
return `cleanup_incomplete` with process and namespace details. A supervised
tombstone retains uncertain cleanup; call again to inspect/retry after external
repair. Filesystem identity checks are observations, not atomic reservations
against another trusted process replacing a path during unlink.

Successful stop is idempotent during the 60-second token retention period.
After token expiry or application shutdown, returns `ownership_expired`.
Stop explicitly before application shutdown when the caller needs a verified
cleanup result. OTP application shutdown itself does not prove native cleanup.
Incomplete shutdown writes a private recovery report outside the owned socket
directory and logs its location or write failure; no automatic recovery runs.

## Parameters

- `Ownership` (`ownership()`)

## Guides

Pages that discuss `stop_owned/1`.

- [Ownership and identity](/en/erlang/latest/topics/ownership/)

## In other ports

Shut the tmux server down

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Server.kill`](/en/py/latest/reference/libtmux-server-kill/) (method) |
| Ruby | [`LibTmux::Server#kill`](/en/ruby/latest/reference/libtmux-server-kill/) (method) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`server.Server.kill`](/en/ts/latest/reference/server-server-kill/) (method) |
| Rust | [`server.Server.kill`](/en/rs/latest/reference/server-server-kill/) (method) |
| Go | [`tmux.Server.Kill`](/en/go/latest/reference/tmux-server-kill/) (method) |
| Java | [`io.github.libtmux.Server.killServer`](/en/java/latest/reference/io-github-libtmux-server-server-killserver/) (method) |
| Clojure | [`libtmux.core/kill-server!`](/en/clojure/latest/reference/libtmux-core-kill-server/) (function) |
| Kotlin | [`io.github.libtmux.kotlin.Server.killServer`](/en/kotlin/latest/reference/io-github-libtmux-kotlin-server-killserver/) (method) |
| Scala | [`io.github.libtmux.scaladsl.Server.killServer`](/en/scala/latest/reference/io-github-libtmux-scaladsl-server-killserver/) (method) |
| C# | [`LibTmux.Server.KillAsync`](/en/csharp/latest/reference/libtmux-server-killasync/) (method) |
| C++ | [`libtmux::Server::kill`](/en/cxx/latest/reference/libtmux-server-kill/) (method) |
| Swift | [`Server.killServer()`](/en/swift/latest/reference/server-killserver()/) (method) |
| OCaml | Client.close releases transport resources. The public client API does not terminate a borrowed tmux daemon. |
| Perl | [`LibTmux::Server::kill_server`](/en/perl/latest/reference/libtmux-server-kill_server/) (method). Explicit Server operation. Captured entities remain local observations; use a new snapshot to observe changes. |

No equivalent is recorded in Lua, PowerShell, Julia, Elixir, Common Lisp or F#.
