---
title: Deploy YOURLS with AI on Blossom
url: "/deploy/yourls/"
canonical_url: https://blossom88.com/deploy/yourls/
markdown_url: https://blossom88.com/deploy/yourls.md
summary: Run YOURLS on Blossom to manage short links on your own domain and keep click
  counts in managed MySQL.
categories:
- deployment
- links
- analytics
stack:
- PHP
- Apache
- MySQL
---

# Deploy YOURLS with AI on Blossom

[YOURLS](https://yourls.org/) is a self-hosted URL shortener. Choose a
short name for a long URL and check its click count from the admin page.

![An example short link and its click count in the YOURLS admin page.](/deploy/assets/images/yourls/short-links.webp)

## Ask Your Agent

> **Ask your AI agent:** Deploy YOURLS on Blossom and help me make my first short link.
>
> Follow this guide: https://blossom88.com/deploy/yourls/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and choose a Blossom Cloud Location when you log in. You can also use [Blossom BYOC (bring your own cloud)](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#blossom-byoc).

## Shorten a Link

Add the address of a page you own and choose a short name. Open the
short link in a private window, then check the click count as an admin.

<details class="optional-reading" markdown="1">
<summary>Deployment setup and commands</summary>

Use the [official Apache image](https://hub.docker.com/_/yourls) on port 8080.
Link [managed MySQL](/docs/data/) and pass its connection details through
YOURLS’s database settings. Set the HTTPS Service URL as `YOURLS_SITE`.
Choose a private administrator password and a stable random `YOURLS_COOKIEKEY`.

Keep the installer and admin area behind
[Blossom Account access](/docs/apps/environment-access/). After first-run
setup, add the short link’s exact path to the Environment’s public paths.

    blossom profile:show
    blossom app:create --data app.yml
    blossom environment:create --data environment.yml
    blossom database_instance:create --data mysql.yml
    blossom environment_link:create --data database-link.yml
    blossom service:create --data web.yml
    blossom env_var:push --environment environment-100 --file .env.production
    blossom environment:deploy --id environment-100 --follow
    blossom environment:update --id environment-100 --data public-paths.yml

</details>

## What You Get

- Short links on your own domain and a private admin page
- Link destinations and click counts in managed MySQL
