<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Arie Kurniawan</title>
    <description>The latest articles on DEV Community by Arie Kurniawan (@arkwrn).</description>
    <link>https://dev.to/arkwrn</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F998082%2F9d868bc8-dc97-49d4-a0dc-96d374964ad7.png</url>
      <title>DEV Community: Arie Kurniawan</title>
      <link>https://dev.to/arkwrn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arkwrn"/>
    <language>en</language>
    <item>
      <title>SSH into a Server Without a Public IP Using Cloudflare Tunnel &amp; Access</title>
      <dc:creator>Arie Kurniawan</dc:creator>
      <pubDate>Mon, 16 Nov 2026 16:59:05 +0000</pubDate>
      <link>https://dev.to/arkwrn/ssh-into-a-server-without-a-public-ip-using-cloudflare-tunnel-access-6hn</link>
      <guid>https://dev.to/arkwrn/ssh-into-a-server-without-a-public-ip-using-cloudflare-tunnel-access-6hn</guid>
      <description>&lt;p&gt;Opening an SSH port to the internet means one more door to guard. Cloudflare Tunnel flips the direction: the server connects out to Cloudflare, not the other way around, so there is no inbound port to open. Cloudflare Access adds a login layer before traffic reaches the server. This guide walks through the whole setup from scratch, with screenshots at every step. Estimated time: 15-20 minutes.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Privacy note:&lt;/strong&gt; the screenshots in this post are redacted. Domains, IPs, account names, and tunnel tokens are masked.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What you need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A Cloudflare account with an active domain (example: &lt;code&gt;example.com&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;A Linux server with &lt;code&gt;sudo&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cloudflared&lt;/code&gt; on the server (install command in step 7)&lt;/li&gt;
&lt;li&gt;A browser for the Cloudflare Access login&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; this guide uses &lt;code&gt;ssh.example.com&lt;/code&gt; and local port &lt;code&gt;13932&lt;/code&gt;. Replace them with your own domain and port.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  1. Create an app in Zero Trust
&lt;/h2&gt;

&lt;p&gt;Start with the application you want to protect. In Cloudflare, this app is the front door before traffic reaches your server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwy30mden3no232dx8m8m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwy30mden3no232dx8m8m.png" alt="Applications page in the Cloudflare Zero Trust dashboard" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to &lt;strong&gt;Zero Trust &amp;gt; Access controls &amp;gt; Applications&lt;/strong&gt;, then click &lt;strong&gt;Create new application&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Choose the Self-hosted app type
&lt;/h2&gt;

&lt;p&gt;There are several app types here; for SSH we use the self-hosted path.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh81nuoc8sdflb1n4kms4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh81nuoc8sdflb1n4kms4.png" alt="Add an application dialog" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;Add an application&lt;/strong&gt; dialog, select &lt;strong&gt;Self-hosted and private&lt;/strong&gt;, then click &lt;strong&gt;Continue with Self-hosted and private&lt;/strong&gt;. The &lt;strong&gt;SaaS applications&lt;/strong&gt;, &lt;strong&gt;Infrastructure&lt;/strong&gt;, and &lt;strong&gt;Bookmarks&lt;/strong&gt; tabs are for other scenarios, so skip them for now.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Self-hosted and private is for internal services such as SSH. If you are exposing a SaaS app, use the &lt;strong&gt;SaaS applications&lt;/strong&gt; tab instead.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  3. Set the domain and Access policy
&lt;/h2&gt;

&lt;p&gt;Next we choose the public address and who is allowed in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2oxnfb7ittximfsx21q1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2oxnfb7ittximfsx21q1.png" alt="Hostname and Access Policies settings" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fill in &lt;strong&gt;Subdomain&lt;/strong&gt; &lt;code&gt;ssh-demo&lt;/code&gt; and &lt;strong&gt;Domain&lt;/strong&gt; &lt;code&gt;example.com&lt;/code&gt;; leave &lt;strong&gt;Path&lt;/strong&gt; at the default (&lt;code&gt;/&lt;/code&gt;). Under &lt;strong&gt;Access policies&lt;/strong&gt;, add an &lt;strong&gt;Allow&lt;/strong&gt; policy for your email. Only addresses in that policy can connect.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; one app can have multiple policies. &lt;strong&gt;Allow&lt;/strong&gt; grants access; &lt;strong&gt;Deny&lt;/strong&gt; always wins.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  4. Open the Tunnels page
&lt;/h2&gt;

&lt;p&gt;Tunnels live under Networking, not under the Access app page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2fpyw1teigr329cj5vnn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2fpyw1teigr329cj5vnn.png" alt="Tunnels list under Cloudflare Networking" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to &lt;strong&gt;Networking &amp;gt; Tunnels&lt;/strong&gt; in the Cloudflare sidebar, then click &lt;strong&gt;Create Tunnel&lt;/strong&gt;. A tunnel is an outbound connection from your server to Cloudflare's network.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Name the tunnel
&lt;/h2&gt;

&lt;p&gt;Pick a recognizable name, such as &lt;code&gt;ssh-demo&lt;/code&gt;, then click &lt;strong&gt;Create Tunnel&lt;/strong&gt;. This is only a dashboard label; the public hostname is configured in step 8.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fok01plij4dh6d1uy0zos.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fok01plij4dh6d1uy0zos.png" alt="Create a Tunnel name form" width="799" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Allow the local port
&lt;/h2&gt;

&lt;p&gt;Check the server firewall with &lt;code&gt;sudo ufw status verbose&lt;/code&gt;. The port you will use (for example &lt;code&gt;13932&lt;/code&gt;) must show &lt;strong&gt;ALLOW IN&lt;/strong&gt;. If it does not, open it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ufw status verbose
sudo ufw allow 13932/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; if your server uses firewalld, iptables, or a cloud security group, open the same port there too.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyjbjea645dhv0r1iyy40.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyjbjea645dhv0r1iyy40.png" alt="ufw status output on the server" width="799" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Choose the OS and copy the install commands
&lt;/h2&gt;

&lt;p&gt;Cloudflare generates install commands for your server's operating system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fybgczwwcr65z3nb2wdtf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fybgczwwcr65z3nb2wdtf.png" alt="cloudflared install commands for the selected OS" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose the &lt;strong&gt;Operating System&lt;/strong&gt; and &lt;strong&gt;Architecture&lt;/strong&gt; (for example Linux, amd64), then copy the two commands: &lt;strong&gt;Install cloudflared&lt;/strong&gt; and &lt;strong&gt;Install as service&lt;/strong&gt;. The token in the second command is a secret, so do not share it.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Add a route to the local service
&lt;/h2&gt;

&lt;p&gt;Open the tunnel you just created, go to the &lt;strong&gt;Routes&lt;/strong&gt; tab, then click &lt;strong&gt;Add a route &amp;gt; Published application&lt;/strong&gt;. This maps the public hostname to the service running on your server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkeccmp74hu31g6z1o1gf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkeccmp74hu31g6z1o1gf.png" alt="Routes tab on the tunnel detail page" width="799" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set the hostname to &lt;code&gt;ssh.example.com&lt;/code&gt; and the &lt;strong&gt;Service URL&lt;/strong&gt; to &lt;code&gt;ssh://localhost:13932&lt;/code&gt;. The &lt;strong&gt;Published application&lt;/strong&gt; route type exposes a local service through a hostname.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frkpz48ohettytrsfsr67.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frkpz48ohettytrsfsr67.png" alt="Add a published application route form" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;strong&gt;Add route&lt;/strong&gt; to save. If your local port is different, change the number in the Service URL.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Verify the route
&lt;/h2&gt;

&lt;p&gt;Once saved, the route appears in the list.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fniunlr8tyac5kboydku3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fniunlr8tyac5kboydku3.png" alt="Route successfully added to the tunnel" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check the hostname, the &lt;strong&gt;Published application&lt;/strong&gt; type, and the Service URL before moving on.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Check the cloudflared version
&lt;/h2&gt;

&lt;p&gt;On the server, run &lt;code&gt;cloudflared --version&lt;/code&gt;. If it prints a version (for example 2026.10.7), cloudflared is installed and ready.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj7t7ief1uhz86t6bs8lo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj7t7ief1uhz86t6bs8lo.png" alt="cloudflared --version output" width="800" height="122"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Install cloudflared as a service
&lt;/h2&gt;

&lt;p&gt;Copy the &lt;strong&gt;Install as service&lt;/strong&gt; command from the dashboard and run it on the server. On success you will see &lt;code&gt;Linux service for cloudflared installed successfully&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; the token in the Install as service command is a tunnel credential. Do not commit it to a repo or share it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgwwxwqv44y19douad2sy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgwwxwqv44y19douad2sy.png" alt="Installing cloudflared as a Linux service" width="798" height="91"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  12. Confirm the tunnel is connected
&lt;/h2&gt;

&lt;p&gt;Once the service is running, Cloudflare shows the tunnel connection status.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa8sj6edyhp2ndpmps4n9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa8sj6edyhp2ndpmps4n9.png" alt="Tunnel connected successfully indicator" width="800" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Back in the dashboard, the status should switch to &lt;strong&gt;Tunnel connected successfully&lt;/strong&gt;. If it is still &lt;strong&gt;Waiting&lt;/strong&gt;, check the service on the server (step 11).&lt;/p&gt;

&lt;h2&gt;
  
  
  13. Check that the tunnel is Healthy
&lt;/h2&gt;

&lt;p&gt;The tunnel list shows whether the connection stays healthy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6286qwjq16isc0dktnn8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6286qwjq16isc0dktnn8.png" alt="Tunnel list showing Healthy status" width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The tunnel should show &lt;strong&gt;Healthy&lt;/strong&gt; with one replica. In this example &lt;code&gt;ssh-demo&lt;/code&gt; has one app (route) and version 2026.10.7.&lt;/p&gt;

&lt;h2&gt;
  
  
  14. Configure the SSH client
&lt;/h2&gt;

&lt;p&gt;The last step on the client side: tell SSH how to reach that hostname.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyep991el8dvcx66wp3uk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyep991el8dvcx66wp3uk.png" alt="SSH config file for cloudflared" width="800" height="884"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On your local machine, add a Host block to &lt;code&gt;~/.ssh/config&lt;/code&gt;. The key line is &lt;code&gt;ProxyCommand cloudflared access ssh --hostname %h&lt;/code&gt;; &lt;strong&gt;HostName&lt;/strong&gt;, &lt;strong&gt;User&lt;/strong&gt;, and &lt;strong&gt;IdentityFile&lt;/strong&gt; depend on your server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nc"&gt;Host&lt;/span&gt; &lt;span class="n"&gt;my&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;server&lt;/span&gt;
    &lt;span class="nc"&gt;HostName&lt;/span&gt; &lt;span class="n"&gt;ssh&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;
    &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="n"&gt;ubuntu&lt;/span&gt;
    &lt;span class="nc"&gt;IdentityFile&lt;/span&gt; &lt;span class="o"&gt;~/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ssh&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;id_ed25519&lt;/span&gt;
    &lt;span class="nc"&gt;ProxyCommand&lt;/span&gt; &lt;span class="n"&gt;cloudflared&lt;/span&gt; &lt;span class="n"&gt;access&lt;/span&gt; &lt;span class="n"&gt;ssh&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;hostname&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; on macOS and Linux the file lives at &lt;code&gt;~/.ssh/config&lt;/code&gt;; on Windows it is &lt;code&gt;%USERPROFILE%\.ssh\config&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  15. Try the SSH connection
&lt;/h2&gt;

&lt;p&gt;Time to test from your local terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh my-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the &lt;strong&gt;Host&lt;/strong&gt; name from your config. If the configuration is right, SSH calls &lt;code&gt;cloudflared&lt;/code&gt; and opens your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  16. Approve access in the browser
&lt;/h2&gt;

&lt;p&gt;Cloudflare Access asks for approval before the connection is forwarded.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr5ivinongqhtm7g4nev6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr5ivinongqhtm7g4nev6.png" alt="Cloudflare Access approval page in the browser" width="799" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The browser opens the &lt;strong&gt;Access Requested&lt;/strong&gt; page. Click &lt;strong&gt;Approve&lt;/strong&gt;, and the SSH session connects. You only need to approve once per browser session.&lt;/p&gt;

&lt;h2&gt;
  
  
  Done
&lt;/h2&gt;

&lt;p&gt;Your server is now reachable over SSH without opening a port to the internet, and every connection goes through Cloudflare Access.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other services
&lt;/h2&gt;

&lt;p&gt;The same pattern works for any service running on a server or laptop. Only the &lt;strong&gt;Service URL&lt;/strong&gt; changes when you create the route:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Web app          http://localhost:3000
REST API         http://localhost:8080
PostgreSQL       tcp://localhost:5432
MySQL            tcp://localhost:3306
Redis            tcp://localhost:6379
RDP              rdp://localhost:3389
SSH              ssh://localhost:13932
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The steps stay the same: start the service, allow the port in the firewall, then add a route with the Service URL above. For non-HTTP services such as databases and RDP, Cloudflare still forwards the TCP connection through the tunnel hostname.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; keep databases and RDP behind an Access policy. Do not expose a database port publicly without authentication.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Expose localhost temporarily
&lt;/h2&gt;

&lt;p&gt;If you only need to share a service running on your laptop for a few minutes, you have two options. Both live only while the laptop is on and the &lt;code&gt;cloudflared&lt;/code&gt; process is running.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 1: Quick tunnel (random domain, no login)
&lt;/h3&gt;

&lt;p&gt;A quick tunnel is the fastest route: one command, no Cloudflare login, a random public URL, and the tunnel dies when the process stops. If &lt;code&gt;cloudflared&lt;/code&gt; is not installed on the laptop yet, install it first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# macOS&lt;/span&gt;
brew install cloudflared

&lt;span class="c"&gt;# Linux Debian/Ubuntu (amd64; use arm64 for ARM)&lt;/span&gt;
&lt;span class="nv"&gt;BASE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://github.com/cloudflare/cloudflared/releases/latest/download
curl -L -o cloudflared.deb &lt;span class="s2"&gt;"$BASE/cloudflared-linux-amd64.deb"&lt;/span&gt;
sudo dpkg -i cloudflared.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then start the quick tunnel from your project folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cloudflared tunnel --url http://localhost:3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;3000&lt;/code&gt; with your web app's port. The command prints a URL like &lt;code&gt;https://random-words.trycloudflare.com&lt;/code&gt;. Open it from another device while the terminal is still running. This tunnel only lives while the laptop is on and the &lt;code&gt;cloudflared&lt;/code&gt; process has not been stopped. There is no Access login page in front of it.&lt;/p&gt;

&lt;p&gt;Because there is no authentication, anyone with the link can reach your service. Share it only with people you trust, and stop it with &lt;code&gt;Ctrl+C&lt;/code&gt; when you are done. If the laptop sleeps, the terminal closes, or the connection drops, the URL stops working.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; do not use a quick tunnel for databases, SSH, admin panels, or services that store sensitive data. Use a permanent tunnel with an Access policy for those, as in steps 1-16.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Option 2: Your own domain (Cloudflare account required)
&lt;/h3&gt;

&lt;p&gt;If you want a stable URL such as &lt;code&gt;dev.example.com&lt;/code&gt;, create a named tunnel. This option needs a domain that is active on Cloudflare, but the tunnel can still run temporarily from your laptop.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;Zero Trust &amp;gt; Networking &amp;gt; Tunnels&lt;/strong&gt;, create a new tunnel, for example &lt;code&gt;laptop-dev&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Open &lt;strong&gt;Routes &amp;gt; Add route &amp;gt; Published application&lt;/strong&gt;. Set the hostname to &lt;code&gt;dev.example.com&lt;/code&gt; and the &lt;strong&gt;Service URL&lt;/strong&gt; to &lt;code&gt;http://localhost:3000&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Copy the tunnel token from the install page, then run it on the laptop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cloudflared tunnel run --token &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;TOKEN&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;https://dev.example.com&lt;/code&gt; while the terminal is running. Without an Access application, this URL is public; to restrict it, create an Access application for &lt;code&gt;dev.example.com&lt;/code&gt; as in steps 1-3.&lt;/p&gt;

&lt;p&gt;Use a separate tunnel for the laptop instead of the server token. The tunnel still stops when the laptop sleeps, the terminal closes, or you press &lt;code&gt;Ctrl+C&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tunnel is not Healthy:&lt;/strong&gt; check &lt;code&gt;sudo systemctl status cloudflared&lt;/code&gt; and &lt;code&gt;journalctl -u cloudflared -n 50&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSH connection refused:&lt;/strong&gt; verify the Service URL and local port, and make sure the port is allowed in the firewall.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Access denied:&lt;/strong&gt; make sure your email is in the app's Allow policy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Browser does not open:&lt;/strong&gt; run &lt;code&gt;cloudflared access ssh --hostname ssh.example.com&lt;/code&gt; manually.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>cloudflare</category>
      <category>ssh</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
