Simple template for code-server
Hello,
I'm new in this field. so forgive me if I'm misunderstanding.
I wanted to provide a web based IDE for multiple developers on a remote server. so that each user could log in to the server and open his own instance of the IDE. from what I read in the docs coder could provide this solution for me.
I followed the documentation instructions and now I have a workspace running from the following template:
https://github.com/coder/coder/discussions/3466
However when I open the workspace in the web UI. there is no button for the IDE. it seems that no agent is running. am I doing anything wrong?
Also I tried the docker-code-server template too. in that case there was an agent named main but again no IDE or Terminal button.
GitHub
Simple template for code-server · Discussion #3466 · coder/coder
Hello, I'm new in this field. so forgive me if I'm misunderstanding. I wanted to provide a web based IDE for multiple developers on a remote server. so that each user could log in t...
40 Replies
yes! that's normal
you have to use a provider for the machine the IDE will run on
currently you're asking it to run code-server on thin air
a provider is docker, amazon aws, etc
basically a place where you can deploy machines/containers
@Mixture do you have docker on your machine?
it's the simplest way imo
yes I do. I also tried the docker-code-server template but couldn't acces any IDE
let's use that template instead
your current template is just invalid atm
what happens when you use the docker-code-server template?
the workspace starts running and when I open the web UI and click on the workspace an agent named main is running but no Icon for IDE or Terminal is visible
can you screenshot?
sure, I'll try it again now
@Phorcys In the logs I can also see a warning which I don't know if it's related or not:
Warning: The access URL http://127.0.0.1:7080 isn't externally reachable, this may cause unexpected problems when creating workspaces. Generate a unique *.try.coder.app URL
it is
that was my hypothesis
hold on 1s
can you send me your template
well, docker-code-server
I haven't edited it. but ok I'll send it
yeh I'm on mobile atm so it's hard to find it
(previous file was wrong)
hmm
it should be fine though
@kyle any idea?
it should be replaced to host.docker.internal properly i don't see what's wrong
Here is the
/etc/coder.d/coder.env
if it helps:
I don't think we resolve the address, so either changing the environment variable to
CODER_ADDRESS=127.0.0.1:7080
or updating the template to replace localhost
instead of 127.0.0.1
might work in this case.@maf I'll try it. should I restart the coder service after changing the env variable?
Yup, that's needed for the change to become effective 👍
A stop/start on the workspace afterwards too (or delete/create).
one question, what is the difference between CODER_ACCESS_URL and CODER_ACCESS it quite confused me at the first place.
that shouldn't cause issues though
the template replaces 127.0.0.1 with host.docker.internal
Oh right, mb, I misread (thought I was talking about
CODER_ACCESS_URL
. The difference between those two are:
- CODER_ADDRESS
tells coder server
where to listen
- CODER_ACCESS_URL
lets coder server
inform workspaces how to talk to it
Are you running Coder on macOS or Linux (or Windows)? Or are you running Coder (server) inside Docker as well?It's linux. the coder service itself is not ran by docker.
by the way changing to
CODER_ADDRESS="127.0.0.1:7080"
caused the workspace to fail to run.
Do I revert back to CODER_ADDRESS="localhost:7080"
?
(Also this is a remote server and I'm using port forwarding to reach to localhost:7080)Oh, that does change things.. hmm so in that case you can go ahead and revert, yeah. I honestly don't see why there would be a difference but if there is then go ahead.
But wait, is Docker and Coder running on the same, or different servers?
The same
Ok
Then you'll want a way for the Docker workspaces to talk to your server, listening only on localhost would prevent that (AFAIK).
One option is to set
CODER_ADDRESS=0.0.0.0:7080
, another is to set it to the IP of e.g. the docker0
interface (something like 127.17.0.1
), I'm not 100% sure tbh.
Just know that if you set it to 0.0.0.0
, then Coder will listen on all interfaces (also public IPs, if there are any).I'm not an expert does this cause any security issues?
It depends. Is your server accessible to the outside world? If yes, then without blocking that port with a firewall, anyone could load up the Coder UI on your server.
there is a jump server in between. but the coder UI itself doesn't have authentication ? (Thanks for your replies by the way)
The Coder UI does have authentication, yeah. But even then some users won't feel comfortable exposing it to the outside world (risk mitigation).
@maf Changing to
CODER_ADDRESS=0.0.0.0:7080
solved it! Thanks alot.
In the first place I wanted to run code-server without docker. so I tried to create a simple template. Isn't there any other local provider option than docker?Ben has some nice templates over at https://github.com/bpmct/coder-templates, I think at least the
shared-mac
template uses local user accounts, no Docker. You could take a look at that.Great, I'll try them.
The install section in the documentation (without docker) is not complete I guess. I had to figure out the CODER_ADDRESS and CODER_ACCESS_URL by myself. I suggest for more information about this situation there.
Thanks for your time
Could you link the part of the documentation that was unclear? And thanks a lot for the feedback, it's very valuable to us, we want our documentation to be as clear and easy to understand as possible!
sure,
https://coder.com/docs/coder-oss/latest/install#system-packages
here it says
# Set up an external access URL or enable CODER_TUNNEL
sudo vim /etc/coder.d/coder.env
but not exactly how to set the env variables or what the env variables actually are used for.Installation - Coder OSS main docs
How to install and deploy Coder
I tried to figure out the difference between
CODER_ADDRESS
and CODER_ACCESS_URL
but couldn't find it there. the docker-compose
section only contained the CODER_ACCESS_URL
and it miss-leaded me.
after all my knowledge is limited but I just wanted to give a feedback on this.Oh yeah I can totally see that happening, it's bits of information without really informing how it ties together. Thanks for pointing it out!
you're welcome
hi @Mixture - we heard your feedback and created a
Configuration
doc to define the primary env vars in /etc/coder.d/coder.env
. Feel free to let us know if you have any thoughts on this page!
https://coder.com/docs/coder-oss/latest/install/configureConfiguration - Coder OSS main docs
Learn how to configure Coder
AFAIK there's an issue about thisnalredy
that's great. The only thing I can add is using
127.0.0.1
instead of localhost
which is recommended in that page failed in my case. (but maybe it just has to do with our servers configuration) the following issue is related too:
https://github.com/coder/coder/issues/2874GitHub
CODER_ACCESS_URL
shouldn't require protocol · Issue #2874 · coder...As a user, if the access URL is set to localhost:6080 instead of http://localhost:6080, workspaces will fail to build since "localhost" is assumed to be the protocol. We should ei...