# ntfy

ntfy lets you send push notifications to your phone or desktop via scripts from any computer, using simple HTTP PUT or POST requests.

### References

<ReferenceLinks references={frontmatter.references} />

---

## Make directory

```sh wrap preserveIndent
mkdir -p {{DOCKER_PATH_VAR}}/ntfy && cd {{DOCKER_PATH_VAR}}/ntfy
```

## compose.yml

```sh
nano compose.yml
```

```yml title="compose.yml"
yaml
```

## ./config/server.yml

```sh
nano ./config/server.yml
```

```yml title="./config/server.yml"
serverYml
```

## Start container

```sh
docker compose up -d
```

## Create admin user

```sh
docker exec -it ntfy ntfy user add --role=admin {{USERNAME_VAR}}
```

## Create token

```sh
docker exec -it ntfy ntfy token add {{USERNAME_VAR}}
```

## Example usage

### HTTP

```sh
curl -X POST "http://localhost:8383/test_topic"   -H "Authorization: Bearer <tk_your_token>"   -H "Title: Test Title"   -H "Tags: rocket,star"   -H "Priority: default"   -d "Message using a token"
```

### CLI

_Requires CLI to be installed through your package manager._

```sh
ntfy publish   --host="http://localhost:8383"   --token="<tk_your_token>"   --title="Test Title"   --tags="rocket,star"   --priority="default"   test_topic "Message using a token"
```

## Open web ui

<OpenWebUI port="8383/test_topic" />
