<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Marketing Archives - ServerStadium</title>
	<atom:link href="https://serverstadium.com/knowledge-base/tag/marketing/feed/" rel="self" type="application/rss+xml" />
	<link>https://serverstadium.com/knowledge-base/tag/marketing/</link>
	<description>Public Cloud Solution by ServerStadium</description>
	<lastBuildDate>Tue, 12 Aug 2025 18:28:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://serverstadium.com/wp-content/uploads/2023/04/cropped-favicon-1-32x32.png</url>
	<title>Marketing Archives - ServerStadium</title>
	<link>https://serverstadium.com/knowledge-base/tag/marketing/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>YOURLS: Branded URL Shortener on a Dedicated Server</title>
		<link>https://serverstadium.com/knowledge-base/yourls-url-shortener-dedicated-servers/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Tue, 12 Aug 2025 18:28:26 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=12203</guid>

					<description><![CDATA[<p>Introduction Run a branded URL shortener with YOURLS on a ServerStadium dedicated server (or ServerStadium VM). This guide sets up YOURLS on Ubuntu&#160;24.04 with Nginx, PHP&#160;8.3, MariaDB/MySQL, and automatic HTTPS via Let’s Encrypt—so your team gets short links, click analytics, and a simple admin UI on your own domain. Prerequisites A ServerStadium dedicated server or&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/yourls-url-shortener-dedicated-servers/">YOURLS: Branded URL Shortener on a Dedicated Server</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p class="wp-block-paragraph">Run a branded URL shortener with <strong>YOURLS</strong> on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=yourls">ServerStadium dedicated server</a> (or <a href="https://serverstadium.com/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=yourls">ServerStadium VM</a>). This guide sets up YOURLS on Ubuntu&nbsp;24.04 with Nginx, PHP&nbsp;8.3, MariaDB/MySQL, and automatic HTTPS via Let’s Encrypt—so your team gets short links, click analytics, and a simple admin UI on your own domain.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<ul class="wp-block-list">
  <li>A <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&amp;utm_medium=article&amp;utm_campaign=yourls">ServerStadium dedicated server</a> or <a href="https://serverstadium.com/?utm_source=kb&amp;utm_medium=article&amp;utm_campaign=yourls">VM</a> running Ubuntu&nbsp;24.04.</li>
  <li>A domain like <code>sho.rt</code> or <code>yourls.example.com</code> pointing to your server’s public IP.</li>
  <li>SSH access with a sudo-capable user and an email address for Let’s Encrypt notices.</li>
</ul>



<h2 class="wp-block-heading">Step 1 — Install Nginx, PHP-FPM, and MariaDB</h2>


<pre><code>sudo apt update && sudo apt -y upgrade
sudo apt -y install nginx mariadb-server \
  php8.3-fpm php8.3-mysql php8.3-curl php8.3-xml php8.3-mbstring php8.3-gd php8.3-zip php8.3-intl \
  unzip curl certbot python3-certbot-nginx

sudo systemctl enable --now nginx mariadb php8.3-fpm
</code></pre>


<h2 class="wp-block-heading">Step 2 — Create the Database</h2>


<pre><code>sudo mysql_secure_installation

sudo mysql -e "CREATE DATABASE yourls DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
sudo mysql -e "CREATE USER 'yourlsuser'@'localhost' IDENTIFIED BY 'ChangeThisStrongPassword!';"
sudo mysql -e "GRANT ALL PRIVILEGES ON yourls.* TO 'yourlsuser'@'localhost'; FLUSH PRIVILEGES;"
</code></pre>


<h2 class="wp-block-heading">Step 3 — Download YOURLS (Latest Stable) and Deploy</h2>



<p class="wp-block-paragraph">This uses the current stable release (1.10.2). Adjust if a newer stable version is available.</p>


<pre><code>sudo mkdir -p /var/www/yourls
cd /tmp
wget -O yourls.tar.gz https://github.com/YOURLS/YOURLS/archive/refs/tags/1.10.2.tar.gz
tar -xzf yourls.tar.gz
sudo rsync -a YOURLS-1.10.2/ /var/www/yourls/
sudo chown -R www-data:www-data /var/www/yourls
</code></pre>


<h2 class="wp-block-heading">Step 4 — Configure YOURLS</h2>


<pre><code># Create the user config directory
sudo mkdir -p /var/www/yourls/user

# Generate a cookie key
CK=$(openssl rand -base64 48)

# Write config.php (edit domain, users, and passwords as needed)
sudo tee /var/www/yourls/user/config.php >/dev/null <<EOF
&lt;?php
/* MySQL settings */
define( 'YOURLS_DB_USER', 'yourlsuser' );
define( 'YOURLS_DB_PASS', 'ChangeThisStrongPassword!' );
define( 'YOURLS_DB_NAME', 'yourls' );
define( 'YOURLS_DB_HOST', 'localhost' );
define( 'YOURLS_DB_PREFIX', 'yourls_' );

/* Site options */
define( 'YOURLS_SITE', 'https://yourls.example.com' ); // your short domain, no trailing slash
define( 'YOURLS_PRIVATE', true );                       // admin area requires login
define( 'YOURLS_UNIQUE_URLS', true );
define( 'YOURLS_COOKIEKEY', '$CK' );                    // random secret key

/* Admin user(s) */
$yourls_user_passwords = array(
  'admin' => 'ChangeThisStrongPassword!'                // set a strong password
);

/* Optional locale and timezone */
// define( 'YOURLS_LANG', '' );
// define( 'YOURLS_HOURS_OFFSET', 0 );
EOF

sudo chown www-data:www-data /var/www/yourls/user/config.php
sudo chmod 440 /var/www/yourls/user/config.php
</code></pre>


<h2 class="wp-block-heading">Step 5 — Nginx Server Block + PHP-FPM</h2>


<pre><code>sudo tee /etc/nginx/sites-available/yourls >/dev/null <<'EOF'
server {
    listen 80;
    listen [::]:80;
    server_name yourls.example.com;

    root /var/www/yourls;
    index index.php;

    # YOURLS loader: route all unmatched paths to yourls-loader.php
    location / {
        try_files $uri $uri/ /yourls-loader.php$is_args$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
    }

    # Security: deny access to hidden files (except .well-known for ACME)
    location ~ /\.(?!well-known) {
        deny all;
    }
}
EOF

sudo ln -s /etc/nginx/sites-available/yourls /etc/nginx/sites-enabled/yourls
sudo nginx -t &#038;&#038; sudo systemctl reload nginx
</code></pre>


<h2 class="wp-block-heading">Step 6 — Enable HTTPS (Let’s Encrypt)</h2>


<pre><code>sudo certbot --nginx -d yourls.example.com --redirect -m you@example.com --agree-tos -n
</code></pre>


<h2 class="wp-block-heading">Step 7 — Run the Installer &amp; Log In</h2>



<ul class="wp-block-list">
  <li>Open <code>https://yourls.example.com/admin/install.php</code> to create the database tables.</li>
  <li>Then go to <code>https://yourls.example.com/admin/</code> and log in with the admin user configured in <code>config.php</code>.</li>
  <li>Create your first branded short link and share it!</li>
</ul>



<h2 class="wp-block-heading">Optional: Public API &amp; Plugins</h2>



<ul class="wp-block-list">
  <li>For team usage only, keep YOURLS private (default). If you want a public API, set <code>define('YOURLS_PRIVATE_API', false);</code> in <code>config.php</code>.</li>
  <li>Explore plugins (rate limiting, QR codes, custom keywords) from the YOURLS ecosystem to extend functionality.</li>
</ul>



<h2 class="wp-block-heading">Firewall &amp; Service Checks</h2>


<pre><code>sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo systemctl status nginx php8.3-fpm --no-pager
</code></pre>


<h2 class="wp-block-heading">Troubleshooting</h2>



<ul class="wp-block-list">
  <li><strong>Blank/403 at root:</strong> YOURLS intentionally doesn’t show a homepage—use <code>/admin/</code> for the UI. Short URLs still resolve from the root.</li>
  <li><strong>PHP errors:</strong> Ensure PHP&nbsp;8.1+ is installed and FPM socket path matches your version (Ubuntu&nbsp;24.04 uses <code>/run/php/php8.3-fpm.sock</code>).</li>
  <li><strong>Short links 404:</strong> Confirm your Nginx block contains <code>try_files $uri $uri/ /yourls-loader.php$is_args$args;</code> and you reloaded Nginx.</li>
  <li><strong>HTTPS fails:</strong> Check DNS A/AAAA records and re-run <code>certbot --nginx</code>. Inspect logs via <code>journalctl -u nginx -n 100 --no-pager</code>.</li>
</ul>



<p class="wp-block-paragraph">Want an easy, affordable start? Choose an instant <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&amp;utm_medium=article&amp;utm_campaign=yourls">ServerStadium dedicated server</a> and brand your links today.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">With YOURLS on ServerStadium, you control your data, domain, and analytics—all secured over HTTPS. For more help or information about ServerStadium services, visit our <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&amp;utm_medium=article&amp;utm_campaign=yourls">knowledge base</a> or the <a href="https://serverstadium.com/?utm_source=kb&amp;utm_medium=article&amp;utm_campaign=yourls">ServerStadium website</a>.</p>

<p>The post <a href="https://serverstadium.com/knowledge-base/yourls-url-shortener-dedicated-servers/">YOURLS: Branded URL Shortener on a Dedicated Server</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
