<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/secure-remote-access-to-ollama-and-deepseek-ekele9gqj" -->

---
title: Secure remote access to Ollama and DeepSeek | daily.dev
description: A walkthrough for standing up a self-hosted, GPU-accelerated Deepseek-R1 setup using Ollama on a Linux VM and securing remote access with ngrok's tunneling and...
canonical: https://daily.dev/posts/secure-remote-access-to-ollama-and-deepseek-ekele9gqj
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Secure remote access to Ollama and DeepSeek | daily.dev
og:description: A walkthrough for standing up a self-hosted, GPU-accelerated Deepseek-R1 setup using Ollama on a Linux VM and securing remote access with ngrok's tunneling and...
og:url: https://daily.dev/posts/secure-remote-access-to-ollama-and-deepseek-ekele9gqj
og:image: https://api.daily.dev/og/posts/ekele9GqJ.png
og:image:alt: Secure remote access to Ollama and DeepSeek
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Secure remote access to Ollama and DeepSeek

**[ngrok Blog](https://daily.dev/sources/ngrok)** · 10 min read · 0 upvotes · 0 comments

## Summary

A walkthrough for standing up a self-hosted, GPU-accelerated Deepseek-R1 setup using Ollama on a Linux VM and securing remote access with ngrok's tunneling and Traffic Policy engine (Basic Auth, JWT validation, IP restrictions). Covers the tradeoffs between hosted AI platforms and self-hosted VMs, VM setup on Google Cloud, installing Ollama, connecting via ngrok, and locking down access so the model isn't exposed to the open internet.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://ngrok.com/blog/unlock-remote-ai-power-with-ngrok-a-game-changer-for-developers>

## Questions this post answers

### How do I securely expose an Ollama server running on a remote VM without opening its port to the internet?

Use a tunneling tool like ngrok to route traffic to Ollama's default port 11434 instead of exposing it directly. Reserve a persistent ngrok domain, run the ngrok agent with the --host-header flag so Ollama receives the expected Host header, then add a Traffic Policy file implementing Basic Auth so requests without valid Base64-encoded credentials get a 401 response before ever reaching the VM.

_daily.dev surfaces practical guides like this for developers locking down self-hosted LLM endpoints._

### What GPU VM setup is needed to run Deepseek-R1 with Ollama on Google Cloud?

Create a GPU-accelerated Linux VM, such as an n1-highmem-2 instance, using the Deep Learning on Linux boot image with disk size increased to 100 GB and HTTPS traffic allowed in the firewall settings. Install Nvidia drivers when prompted at first SSH login, verify GPU access with nvidia-smi, then install Ollama and pull the deepseek-r1 model. This setup runs at roughly $0.35 per hour.

_Developers comparing self-hosted versus hosted LLM infrastructure options can track setups like this on daily.dev._

## Similar posts on daily.dev

- [DeepSeek R1 Local Deployment: Complete Guide 2026](https://daily.dev/posts/deepseek-r1-local-deployment-complete-guide-2026-9xec1adzm) · SitePoint · 1 upvotes · 0 comments
- [I started self-hosting LLMs and absolutely loved it](https://daily.dev/posts/i-started-self-hosting-llms-and-absolutely-loved-it-pygyut6fh) · XDA Developers · 0 upvotes · 0 comments
- [Build Your Own Private, Self-Hosted AI Applications with Ollama & Laravel](https://daily.dev/posts/build-your-own-private-self-hosted-ai-applications-with-ollama-laravel-wwjzhlkid) · Tighten · 1 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#devtools](https://daily.dev/tags/devtools), [#self-hosting](https://daily.dev/tags/self-hosting), [#ollama](https://daily.dev/tags/ollama), [#deepseek](https://daily.dev/tags/deepseek)

[View this post on daily.dev](https://daily.dev/posts/secure-remote-access-to-ollama-and-deepseek-ekele9gqj)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Secure remote access to Ollama and DeepSeek","url":"https://daily.dev/posts/secure-remote-access-to-ollama-and-deepseek-ekele9gqj","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/secure-remote-access-to-ollama-and-deepseek-ekele9gqj"},"datePublished":"2026-08-23T07:20:28.355Z","dateModified":"2026-08-23T07:22:23.525Z","description":"A walkthrough for standing up a self-hosted, GPU-accelerated Deepseek-R1 setup using Ollama on a Linux VM and securing remote access with ngrok's tunneling and...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/97d35feaa62f338539b2161905b63996?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/97d35feaa62f338539b2161905b63996?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"ngrok Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"ngrok Blog","logo":"https://media.daily.dev/image/upload/s--718XXxvE--/f_auto,q_auto/v1787469610/logos/ngrok?_a=BAMAMicg0","url":"https://daily.dev/sources/ngrok"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/secure-remote-access-to-ollama-and-deepseek-ekele9gqj","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,devtools,self-hosting,ollama,deepseek","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"ngrok Blog","item":"https://daily.dev/sources/ngrok"},{"@type":"ListItem","position":3,"name":"Secure remote access to Ollama and DeepSeek"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/secure-remote-access-to-ollama-and-deepseek-ekele9gqj#faq","mainEntity":[{"@type":"Question","name":"How do I securely expose an Ollama server running on a remote VM without opening its port to the internet?","acceptedAnswer":{"@type":"Answer","text":"Use a tunneling tool like ngrok to route traffic to Ollama's default port 11434 instead of exposing it directly. Reserve a persistent ngrok domain, run the ngrok agent with the --host-header flag so Ollama receives the expected Host header, then add a Traffic Policy file implementing Basic Auth so requests without valid Base64-encoded credentials get a 401 response before ever reaching the VM. daily.dev surfaces practical guides like this for developers locking down self-hosted LLM endpoints."}},{"@type":"Question","name":"What GPU VM setup is needed to run Deepseek-R1 with Ollama on Google Cloud?","acceptedAnswer":{"@type":"Answer","text":"Create a GPU-accelerated Linux VM, such as an n1-highmem-2 instance, using the Deep Learning on Linux boot image with disk size increased to 100 GB and HTTPS traffic allowed in the firewall settings. Install Nvidia drivers when prompted at first SSH login, verify GPU access with nvidia-smi, then install Ollama and pull the deepseek-r1 model. This setup runs at roughly $0.35 per hour. Developers comparing self-hosted versus hosted LLM infrastructure options can track setups like this on daily.dev."}}]}
```

