- Ollama Part 1. Running it from a local terminal : Linux (wsl 2), MacOS
- Ollama Part 2. Running it in a local browser : open-webui
? Ollama Part 3. Running it in an online (on my own domain) browser: sharing the URL with friends
- Ollama Part 4. Applying Retrieval-Augmented RAG
- Ollama Part 5. Applying image recognition
- (in preparation) Ollama Part 6. Applying the MOE (Mixture of Experts) approach
Ollama browser - online, accessing via URL
1. Sign up for ngrok and log in
1) What is ngrok?
ngrok | Unified Application Delivery Platform for Developers
ngrok is a secure unified ingress platform that combines your global server load balancing, reverse proxy, firewall, API gateway and Kubernetes Ingress Controller to deliver applications and APIs.
ngrok.com
First off, ngrok is a tool that provides a way to access a local PC from the outside internet, and many companies are probably already using it. In most cases, it tends to be used so that a developer can easily share a temporary in-development demo with internal product managers or designers.
ngrok is a platform that lets you expose a local server sitting behind NAT and a firewall to the public internet through a secure tunnel (it binds the local server to ngrok.com via a webhook), so it conveniently makes a server you're running locally reachable from outside. That said, it can be quite critical from a security standpoint, so while it works fine as a lightweight way for a dev team to share an in-progress demo, applying it to a publicly available service is a stretch on several fronts.
For the record, this whole process produces the same end result as the old way (back in my day...) back when we used to log into the iptime router admin page and configure DNS and port forwarding to run a home server.
2) Sign up for ngrok and log in
It will automatically take you to the right page based on your computer's OS. From there, you just follow the instructions on that page in order. Only the commands differ; the procedure and overall flow are nearly identical. From this point forward, just copy and paste the code from the page below. The commands shown here are for reference only.
ngrok - Online in One Line
dashboard.ngrok.com
3) Search for [Terminal] from search and run it
4) Type the command to install ngrok via Homebrew and hit enter.
brew install ngrok/ngrok/ngrok
5) Type the command to add an authtoken to the default ngrok.yml configuration file, then hit enter. ( *The token for the logged-in account is already filled in for you, so you can simply copy & paste the code shown on that page.)
ngrok config add-authtoken 2cD7AgtestRQhjGB8EXtestNCYx_5AdmC8testXznTGVtest
6) Open another terminal and start the WebUI you installed in the previous step.
7) Go back to the first terminal you opened earlier, type the command below, and hit enter:
ngrok http http://localhost:8080 ( *The port number at the end should match the port number that appears in the output of the other terminal window. It's usually 8080, but occasionally the port may be set to 3000 or 8000. Since the connection target is the app you started above, base it on the port number shown in that output, not the code shown on the ngrok site.)
If everything goes smoothly up to this point, you'll be able to deploy it online via the upstream service ngrok provides for 'temporary domain forwarding,' as shown below.
8) If you paste the URL generated in the terminal into the browser's address bar, you'll see a status page about the upstream service that ngrok provides.
9) When you click the 'visit site' button, you can see the same result in the browser as when running locally.
