01 · Before you start
Slug is the client. YOURLS is the server.
Slug connects to a YOURLS installation that you control. If you already have a private YOURLS server working over HTTPS, skip to Find your signature.
- A domain or subdomain for short links
- Web hosting that meets YOURLS’ current requirements
- A MySQL or MariaDB database
- HTTPS with a valid certificate
- Permission to administer the server
YOURLS currently documents PHP 8.1 or newer, MySQL 5.5 or newer or MariaDB 10.0 or newer, and the PHP cURL extension for API use. Confirm the current requirements before installing.
02 · Install YOURLS
Use the latest release, not the development branch.
Hosting environments differ, so use your provider’s deployment tools or the official YOURLS instructions. The reliable manual path is:
- 01Download the latest release archive.
Use the current stable package from YOURLS rather than a snapshot of the development branch.
- 02Create a database.
Give YOURLS a dedicated MySQL or MariaDB database and a user limited to that database.
- 03Create your configuration.
Copy
user/config-sample.phptouser/config.php, then add the database, site, and login values. - 04Upload the files.
Place the release in the web root for your short-link domain and apply the permissions recommended by your host.
- 05Run the installer.
Open
https://go.example.com/admin/and follow the installation prompts.
define( 'YOURLS_DB_USER', 'yourls_db_user' );
define( 'YOURLS_DB_PASS', 'use-a-unique-password' );
define( 'YOURLS_DB_NAME', 'yourls' );
define( 'YOURLS_DB_HOST', 'localhost' );
define( 'YOURLS_SITE', 'https://go.example.com' );
define( 'YOURLS_PRIVATE', true );
$yourls_user_passwords = array(
'admin' => 'use-another-unique-password',
);
Slug uses your private YOURLS API. Do not expose the admin area publicly, reuse passwords, commit config.php to source control, or continue without HTTPS.
03 · Authentication
Use a signature instead of your password.
Sign in to the YOURLS admin area and open Tools. Copy the secret signature token shown in the passwordless API section. The signature is tied to your YOURLS user and can make API requests without exposing your login password.
Your YOURLS installation may be configured as public. Signature tokens are available for private installations that use login credentials.
04 · Slug
Add the server to Slug.
- 01Open Slug settings.
Choose the YOURLS server or connection option.
- 02Enter the server URL.
Use the HTTPS address where YOURLS is installed, such as
https://go.example.com. Do not paste an admin-page URL. - 03Paste the signature token.
Use the token from the YOURLS Tools page. Treat it like a password.
- 04Test and save.
Slug verifies the API connection before storing the configuration.
Under the hood, YOURLS serves API requests through yourls-api.php. Slug handles the API path and request formatting for you.
05 · Troubleshooting
If the connection test fails.
Slug cannot reach the server
Open the YOURLS admin page in Safari on the same device. Confirm the URL is correct, HTTPS is valid, and a firewall or host rule is not blocking the request.
The server returns “unauthorized”
Copy the signature again from YOURLS Tools. Make sure it belongs to an active user on this installation and contains no extra spaces.
The API path returns 404
Confirm that yourls-api.php exists at the root of the YOURLS installation and that the server rewrite and PHP configuration match the official server guide.
The signature option is missing
Confirm YOURLS_PRIVATE is set to true. Public installations do not provide user signature tokens.
06 · Maintenance
Keep the server healthy.
- Install stable YOURLS updates using the official upgrade instructions.
- Back up both the database and the
userdirectory. - Keep PHP, the database, the web server, and TLS certificates current.
- Restrict access to
config.phpusing permissions supported by your host. - Rotate the signature if you believe it has been exposed.