Pārlūkot izejas kodu

0663: Running Shlink URL Shortener in Docker on Ubuntu Server

i12bretro 2 gadi atpakaļ
vecāks
revīzija
bdc80d45f9
1 mainītis faili ar 79 papildinājumiem un 0 dzēšanām
  1. 79 0
      0663.html

+ 79 - 0
0663.html

@@ -0,0 +1,79 @@
+    <!DOCTYPE html>
+    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
+      <head>
+        <title>Running Shlink URL Shortener in Docker on Ubuntu Server</title>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+        <meta charset="UTF-8">
+        <meta name="keywords" content="Browser Based,Docker Made Easy,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Web Based Tools,Shlink,Shlink.io,URL Shortener,Self-Hosted URL Shortener,Docker,Ubuntu,Linux,FOSS,Free Open Source Software,Free Software,Docker Simplified,Container,Containerization,Docker How To,Open Source,Open Source Software,How To,Tutorial,i12bretro">
+        <meta name="author" content="i12bretro">
+        <meta name="description" content="Running Shlink URL Shortener in Docker on Ubuntu Server">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <meta name="revised" content="12/10/2022 09:59:33 AM" />
+				          <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
+				  <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
+				        <script type="text/javascript" src="includes/js/steps.js"></script>
+        <link href="css/steps.css" rel="stylesheet" type="text/css" />
+      </head>
+      <body>
+        <div id="gridContainer">
+          <div class="topMargin"></div>
+          <div id="listName" class="topMargin">
+            <h1>Running Shlink URL Shortener in Docker on Ubuntu Server</h1>
+          </div>
+          <div></div>
+          <div id="content">
+          <h2>What is Shlink?</h2>
+
+<blockquote><em>A PHP-based self-hosted URL shortener that can be used to serve shortened URLs under your own custom domain.</em> -<a href="https://github.com/shlinkio/shlink" target="_blank">https://github.com/shlinkio/shlink</a></blockquote>
+
+<h2>Installing Docker</h2>
+
+<ol>
+	<li>Log into the Linux host and run the following commands in a terminal window
+	<div class="codeBlock"># install prerequisites<br />
+	sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y<br />
+	# add docker gpg key<br />
+	curl -fsSL https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release)/gpg | sudo apt-key add -<br />
+	# add docker software repository<br />
+	sudo add-apt-repository &quot;deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release) $(lsb_release -cs) stable&quot;<br />
+	# install docker<br />
+	sudo apt install docker-ce docker-compose containerd.io -y<br />
+	# enable and start docker service<br />
+	sudo systemctl enable docker &amp;&amp; sudo systemctl start docker<br />
+	# add the current user to the docker group<br />
+	sudo usermod -aG docker $USER<br />
+	# reauthenticate for the new group membership to take effect<br />
+	su - $USER</div>
+	</li>
+</ol>
+
+<h2>Running Shlink Container</h2>
+
+<ol>
+	<li>Continue with the following commands in a terminal window
+	<div class="codeBlock"># create working directories<br />
+	mkdir ~/docker/shlink -p &amp;&amp; mkdir ~/docker/mariadb -p<br />
+	# set owner of working directories<br />
+	sudo chown &quot;$USER&quot;:&quot;$USER&quot; ~/docker -R<br />
+	# run the mariadb docker container<br />
+	docker run -d --name <span class="codeBlock">mariadb -e</span> MYSQL_ROOT_PASSWORD=&#39;r00tp@$$&#39; -e MYSQL_USER=shlinkio_rw -e MYSQL_PASSWORD=&#39;$hlink10!&#39; -e MYSQL_DATABASE=shlinkio -v ~/docker/mariadb:/var/lib/mysql --restart=unless-stopped mariadb:latest<br />
+	# run the shlink docker container<br />
+	<span class="codeBlock">docker run -d --name shlink --link mariadb -e DEFAULT_DOMAIN=b.rto:8080 -e USE_HTTPS=false -e DB_DRIVER=maria -e DB_NAME=shlinkio -e DB_USER=shlinkio_rw -e DB_PASSWORD=&#39;$hlink10!&#39; -e DB_HOST=mariadb -e DB_PORT=3306 -p 8080:8080 --restart=unless-stopped shlinkio/shlink:stable</span><br />
+	# run the shlink web client<br />
+	docker run -d --name shlink-web-client -p 8888:80 -v ~/docker/shlink/servers.json:/usr/share/nginx/html/servers.json --restart=unless-stopped shlinkio/shlink-web-client<br />
+	# generate shlink API key<br />
+	docker exec -it shlink shlink api-key:generate</div>
+	</li>
+	<li>Copy the generated API key to the clipboard</li>
+	<li>Open a web browser and navigate to http://DNSorIP:8888</li>
+	<li>Click the Add a server button</li>
+	<li>Enter a name for the server, the URL should be http://DNSorIP:8080 and paste the copied API key created earlier</li>
+	<li>Welcome to <span class="codeBlock">Shlink</span></li>
+</ol>
+
+<p>Source: <a href="https://hub.docker.com/r/shlinkio/shlink" target="_blank">https://hub.docker.com/r/shlinkio/shlink</a><br />
+Documentation: <a href="https://shlink.io/documentation/install-docker-image/" target="_blank">https://shlink.io/documentation/install-docker-image/</a></p>          </div>
+        </div>
+      </body>
+    </html>
+