HomeVideos

How to access your Open WebUI models remotely | Cloudfare Tunneling

Now Playing

How to access your Open WebUI models remotely | Cloudfare Tunneling

Transcript

375 segments

0:00

Hello everyone. This is professor

0:01

patterns and in this video I'm going to

0:02

be showing you how you can host open web

0:04

UI on a website. Now here's what I mean.

0:08

Right now I have open web UI running on

0:09

localhost 3001 and that's perfect,

0:11

right? If I want to use this for my

0:12

local application, great. But what if I

0:15

am at work or something and I want to

0:18

use open web UI that's currently running

0:20

locally on my computer, but I want to

0:22

somehow tunnel to it from my work. Well,

0:25

that's exactly what we're going to learn

0:27

about in this video. So basically what

0:29

it would look like is open web UI would

0:31

be running on a website something like

0:33

this. But of course it's going to have

0:34

some layers of security. So if I go to

0:36

the site first it's going to have me uh

0:39

put in my email. That's when it's going

0:41

to take me to the open web UI homepage.

0:43

And then again I have to sign in. So a

0:46

couple of layers of security that are

0:47

going to be added in. But the good thing

0:49

over here is that now I can actually

0:51

access open web UI even on my phone. So

0:55

just go directly to that link the open

0:57

webbui.prof

0:59

uh

1:00

openwebui.uk and then with that link I

1:02

can access it from anywhere that I want.

1:05

And the best part is that right now

1:07

these are all locally hosted models.

1:10

That means that even though I'm on this

1:12

website if I ask even something say for

1:15

example on my phone. Well if I bring up

1:18

the docker container I can show you

1:19

firsthand if I type a message and hit

1:21

enter. So the message I typed was hey

1:24

and if I hit enter you'll see that on my

1:26

computer it did process that message and

1:29

over here on my phone it gave me a

1:31

response. So that's the overall idea

1:34

that's why we would want to do this. So

1:35

how do we set this all up? Let's go

1:37

ahead and get started. Okay. So first

1:38

you need to go to cloudfare.com and then

1:40

from here you select login. So this is

1:43

going to take you to a login page. Then

1:46

you will select sign up and then just

1:48

simply create an account. All right. So,

1:51

after you create an account, you're

1:52

going to see this page over here. Um,

1:55

you don't really need to do anything

1:56

here. If you wanted to, you could click

1:58

on this icon to take you to a homepage.

2:01

It's fine. Everything else is

2:03

standard. Next up, now I am going to be

2:06

sharing this Google Docs link with you

2:09

because the instructions are different

2:10

depending on whether you're a Windows,

2:12

Mac, or a Linux user. I'm currently on a

2:15

Windows computer. So, this is the

2:17

command that I'm going to copy. Now I

2:20

will then open up my command prompt

2:22

window and then here within command

2:25

prompt I'm going to paste that command.

2:27

So what this is going to do is it's

2:29

going to install cloudfare. Now I've

2:32

already actually done this before. So it

2:34

says found an existing package

2:35

installed. Um if you don't have this

2:38

then it's going to download it the first

2:41

time. It's going to take a second.

2:43

Um, you could even test it by running

2:46

cloudfired and then hyphen hyphen

2:49

version. And this is going to show which

2:51

version of cloudfare you're currently

2:53

running on. Okay, that's perfect. Okay,

2:56

so now here's the thing. If you don't

2:58

care at all about security, um, and you

3:01

just want to do this like a one-time

3:02

thing really quickly, you just want to

3:04

test it out on your phone or whatever,

3:06

um, there is the unsecured wake command.

3:09

So basically all you would do is copy

3:12

this command that I've shared over here.

3:14

Um you just want to change the port to

3:16

wherever you have open web UI running. I

3:18

actually have open web UI on port 30001.

3:20

So I'm just going to change this to

3:21

30001. Um and then over here you just

3:24

simply paste it. And you want to make

3:27

sure that open web UI is currently

3:28

running on that port. And once you do

3:31

that, it's going to create a site for

3:34

you like transmoves

3:36

ignoredharmony.trycloudfair.com.

3:38

trycloudfair.com and if you click on

3:40

this site or controlclick on that site

3:42

it's going to open up open web

3:44

UI and it's not only accessible here

3:48

through your browser it's also

3:50

accessible here on my phone so now what

3:53

you want to do is actually copy this URL

3:57

and then just send yourself an email

3:58

like hey go to this link and then from

4:01

your phone you should be able to access

4:02

it. So I clicked on this link on my

4:05

phone and you can see over here I'm on

4:07

the open web UI homepage. I can select

4:10

sign in and right now I it says hello

4:15

professor and this is actually using

4:16

open web UI. So if I actually open up u

4:21

docker so you can actually see over here

4:25

if I ask a question it's going to be

4:27

using the resources of my computer.

4:29

First thing that I need to do is

4:30

actually open up

4:33

Olama. This way I have all of my local

4:36

models available. Now, here's the thing.

4:39

I can be outside, right? Like I could be

4:41

running an errand and I want to use open

4:43

web UI and I can actually use open web

4:47

UI. It's going to ping the large

4:50

language model that's running on my

4:52

computer. So here let me ask a question

4:55

um like hi how are you? And then as soon

4:59

as I hit enter, you will be able to see

5:01

oh says model not selected. Let me just

5:05

select a random model. And again say the

5:08

same thing. And as as soon as I ask this

5:10

question, we can see over here that it

5:12

also it gets sent directly over here to

5:14

open web UI and I get a

5:16

response. So this is one way in which

5:19

you can do this. not the most securest

5:21

ways, but if you just wanted something

5:23

really quick, really easy, then by all

5:26

means, this is the free way in which you

5:28

can try it out. Now, if you wanted to

5:30

have a little bit more security, then

5:33

this is what you would do. You can

5:35

continue watching. Um, let's go to the

5:38

next step. So, this is login and create

5:40

a tunnel. So, what you have to do is

5:42

copy this command for cloudflared login.

5:46

I'm going to go back over here and I can

5:48

now hit Ctrl + C. I can stop this tunnel

5:51

from working. If I now go to this site,

5:53

it's not going to work. It's completely

5:55

closed. So, let's paste the Cloudflared

5:58

login command. And now, this is going to

6:00

take me over here back to Cloudflare.

6:03

Now, here it says connect your website

6:05

or app. So, that's the first thing I'm

6:08

going to have to do is click on this.

6:10

Now I if I have an existing domain I

6:14

could pretty much just add it over here.

6:16

But if I wanted to I could even register

6:19

a new domain. Now over here I can search

6:21

for a domain like prof patterns open web

6:24

UI or something and then search. Let's

6:27

see what are the ones that are

6:29

available. I literally would just try to

6:31

pick the cheapest possible one. The next

6:34

part is you have to just register and

6:36

then you add a payment method and then

6:39

you would essentially be paying for one

6:41

year for this domain. Okay. So I bought

6:43

this random domain over here and uh $4

6:48

for the entire year. Uh it's not going

6:50

to break the bank or anything. So I'm

6:51

okay with that. Um next step again I

6:54

need to copy this cloudflare login

6:56

command over here. I can just hit Ctrl +

6:59

C and then repaste it. And it's going to

7:03

take me to this page again, but this

7:05

time I will be able to now see this

7:07

domain that I have bought. This is

7:08

authorized tunnel for this website. So,

7:11

let me authorize it. And uh it says you

7:15

may now close this window and start your

7:17

Cloudflare tunnel. Awesome. Okay. Next

7:20

step, you would copy this command and

7:23

then go back over here and paste it.

7:25

Now, after you paste it, it's going to

7:27

give you an ID. It's going to say

7:29

created tunnel and it's going to give

7:31

you some ID and all you would do is just

7:34

copy that. That's your secret key and

7:36

you can store that somewhere. Um maybe

7:38

just create a new text document or

7:40

something and then just make sure you're

7:42

storing that information because we're

7:43

going to be needing that in a second.

7:45

Next, let's go to configure the tunnel.

7:48

So, you want to go to the CloudFare

7:51

folder. So, on a Mac, it's going to be

7:54

in this location. on a Windows is going

7:56

to be your user profile and then it's a

7:59

hidden folder called cloudflared and

8:01

over there you would just create a file

8:03

called config.yaml for both. So

8:07

let's since I'm on a windows computer

8:09

I'm going to go to this

8:12

location see users my name and then

8:17

cloudflared. So over here I can see that

8:19

there's already two files um in this

8:21

folder. Now I can go over here and

8:24

create new and text document. But the

8:27

problem is it's going to by default just

8:29

create the extension u txt. So I can

8:33

either view and show

8:38

the file name

8:40

extensions and then over here after I do

8:43

that if I rename the

8:45

file config.yiml

8:51

YML. Yes. And now you can see the type

8:54

is a YAML source file. Now I can open

8:57

this again with

8:59

um Notepad for example. And what I need

9:04

to do is copy this part. Okay. And then

9:07

next step I need to just simply add my

9:09

tunnel. That's the ID I copied from the

9:11

last step. And this just needs to be um

9:16

again you replace your tunnel ID your

9:19

tunnel ID in both of these steps. You

9:22

also want to make sure that this is path

9:24

to the file. Um so it's basically in the

9:27

same exact location where this file is.

9:31

So, for example,

9:33

um if I go back over here to my folder,

9:35

I can click on show more options or

9:38

properties, for example, and this will

9:41

tell me exactly where the path is for

9:43

this file. Um, so you can simply just

9:46

copy that path and you can add that

9:48

here. And then the last thing is you can

9:50

just simply add your subdomain. So over

9:52

here I'm just going to say open web UI

9:55

and instead of

9:58

trycloudflare.com this is where I can

10:00

add um my website. So for example I can

10:04

say I cannot even remember the site that

10:06

I just bought for $5. Okay. So this is

10:09

the domain that I purchased. This is

10:11

open web UI. Everything else can stay

10:14

the same. Um service is localhost 3001.

10:16

That's only because I have open web UI

10:18

and 3001. If you have it on 3,000, just

10:20

change this to 3,00. And everything else

10:23

can say the same. You can hit save. Now,

10:25

I will simply edit this to my actual um

10:28

values. And then I'm going to hit save.

10:30

Next, we'll copy this command to

10:32

configure the DNS route. And I'm going

10:34

to paste that over

10:36

here. And this has been added in. And

10:40

now finally, we are ready to run. So the

10:43

command that I'm going to run is

10:45

Cloudflare tunnel run open web UI tunnel

10:49

and what that means is every single time

10:51

I go to that website I will now be able

10:55

to access open web UI. So you can see

10:58

open web UI shows up on this site. Now

11:01

suppose that you wanted to have one more

11:03

layer of security. What you could do is

11:05

you could set up a policy such that only

11:07

the people with a specific email address

11:10

can actually sign in to this website.

11:12

Um, so this is another one more

11:15

additional layer of security that you

11:16

can add. So let me show you how you can

11:18

do that as well. So you start by going

11:20

back over to your Cloudflare homepage

11:22

and then you want to select access then

11:25

launch zero trust. Select your

11:28

account and then from here you want to

11:31

create a team name. So I can just say

11:34

prof

11:35

team and then select

11:38

next. Now I'm just going to keep it at

11:40

the free version. So, I'm going to

11:42

select this plan. Once that's done, you

11:44

will be able to see this page over here.

11:46

Now, you can select create an

11:49

application. And we're going to be

11:50

selecting self-hosted over here.

11:53

Application name. Uh, we'll just going

11:55

to call this

11:57

professor patterns open web

12:02

UI. Um, session duration. So, this is

12:05

how long you want it to stay until it

12:07

times out. Just keep it 24 hours for

12:09

now.

12:11

Um here public host name um the

12:13

subdomain is open web UI. The domain is

12:15

what domain you bought. So this actually

12:17

there's a drop down so it kind of comes

12:19

up over here. Um the rest can stay the

12:21

same. Now with this you can add a

12:24

policy. So it actually takes you to a

12:27

different page. So policy name is

12:30

friends only and action is allow session

12:35

duration. Let's just put the at I don't

12:38

know 6 hours, 12 hours, 24, doesn't

12:40

matter. Now add rules. We want to say we

12:45

want to add an email and then the value.

12:48

So only someone with this specific email

12:51

can actually access the website and then

12:54

everything else can stay the same and

12:56

hit save. So the policy has been added.

13:00

Now let's go back over here. I can um

13:04

see the access policy. So this is

13:06

basically back to the add an application

13:07

page. Let's select an existing policy

13:10

and I'm going to select the friends

13:12

only. And then I'm going to hit

13:14

confirm. So now that that's done, I

13:19

don't really need to do anything else. I

13:21

think everything else can just stay

13:22

standard. I mean if I wanted to, I could

13:24

change um login methods and stuff. Maybe

13:27

add some more layers and everything, but

13:29

for now I can just keep it standard. Uh,

13:32

this is the application logo. If I

13:34

wanted to, I could also create a custom

13:36

logo. Uh, for now, I'm just going to

13:38

keep it standard default, so it's going

13:40

to be kind of boring. Uh, so nothing too

13:43

crazy. Everything else can stay the

13:45

same. I could even have like a custom

13:47

landing page if I wanted to, but again,

13:50

just keeping everything standard for

13:52

now. Let's hit next and then select

13:55

save.

13:57

Okay. So now what this is going to allow

14:00

me to do is first over here I'm just

14:02

going to cancel out and then restart. So

14:06

Cloudflare tunnel run open web UI

14:08

tunnel. And now if I click on this site

14:10

it's going to actually take me to this

14:12

login page. So over here I will have to

14:16

put in my email and then it will send me

14:18

a code and then I have to put that code

14:21

back over here and from there it's going

14:23

to take me to my open web UI homepage.

14:26

And that's basically how you can

14:28

configure Open Web UI to also run with

14:31

user

14:32

authentication. That's pretty much it

14:34

for this video. I know that there's so

14:36

much more that I could still cover. Um

14:39

it can basically talk about this for

14:40

hours, but I will caveat first by saying

14:43

that I'm not by any means a expert I

14:46

would say on network um stuff. So, if

14:50

you thought that there I made a mistake

14:51

somewhere or if you felt like, oh, maybe

14:53

I could have or should have done

14:54

something a little bit differently, then

14:56

please feel free to comment in the

14:57

comment section, um, I don't really have

14:59

an ego or anything. I know that I'm not

15:02

going to be always 100% right on

15:04

something, but this is me doing a bunch

15:06

of different research and figuring out

15:07

like, well, maybe this might just be the

15:09

best way that I think um, it could work.

15:12

But, if you think that there's a better

15:13

way, then please let me know. Uh, that's

15:16

pretty much it for this video. Thank you

15:18

all for um tuning in and I will see you

15:20

all in the next one. Goodbye.

Interactive Summary

This video demonstrates how to host Open Web UI on a website, making it accessible from anywhere. It covers two main methods: an unsecured approach for quick testing and a more secure method involving Cloudflare tunnels and domain registration. The process includes setting up a Cloudflare account, installing the Cloudflare client, and configuring tunnels to route traffic to your local Open Web UI instance. For enhanced security, the video explains how to implement user authentication using Cloudflare's Zero Trust platform, allowing access only to users with specific email addresses. The presenter emphasizes that while this method provides remote access to locally hosted models, further security layers and network configurations might be necessary depending on the user's needs.

Suggested questions

5 ready-made prompts