I have working nextcloud/letsencrypt docker container thanks to excellent guide from @macom.
Now I wish to install nginx/letsencrypt in docker for hosting simple website. Should I use nextcloud/letsencrypt stack or create another one? And most important, how to instal nginx/letsencrypt in docker? I'm using OMV 5 and portainer.
Thanks.
[SOLVED] nginx in docker
-
- resolved
- OMV 5.x
- gett
-
-
That's actually really easy for you to do
EDIT: OMV is running on port :80, so you should change that before running this container, or change the ports of the letsencrypt container like this:
-p 7443:443
-p 7780:80I just added a "7" or two. This means that you can catch your website on port :7780 for the http part. eg. 192.168.1.10:780 or mydomain.com:780
I changed the OMV port myself, before doing this. I'm working on implementing a reverse proxy to take care of the ports automatically.
Anyways...sorry about the confusion.
Paste this into your portainer/stacks:
Code
Display More--- version: "2" services: letsencrypt: image: linuxserver/letsencrypt container_name: letsencrypt cap_add: - NET_ADMIN environment: - PUID=1000 - PGID=1000 - TZ=Europe/London - URL=yourdomain.url - SUBDOMAINS=www, - VALIDATION=http - DNSPLUGIN=cloudflare #optional - DUCKDNSTOKEN=<token> #optional - EMAIL=<e-mail> #optional - DHLEVEL=2048 #optional - ONLY_SUBDOMAINS=false #optional - EXTRA_DOMAINS=<extradomains> #optional - STAGING=false #optional volumes: - </path/to/appdata/config>:/config ports: - 443:443 - 80:80 #optional restart: unless-stopped
Change it to your system, like PUID and PGID, TZ, URL, etc. If the validation is "http" you don't need the "DNSPLUGIN=" line 16.
You can add all the domains you like, just add new lines, like "- EXTRA_DOMAINS=domain1.com #optional" and "- EXTRA_DOMAINS=domain2.com #optional"When you have changed all of your settings to your specific system, just push "deploy" and bingo, you have a running website on nginx with let's encrypt.
SourceDH: https://hub.docker.com/r/linuxserver/letsencrypt
SourceGH: https://github.com/linuxserver…ypt/blob/master/README.md -
you have a running website on nginx with let's encrypt
Thank you for answer. One question:
ports:
- 443:443
- 80:80 #optionalI think there will be a conflict with ports, my nextcloud/letsencrypt container uses 443 (and it's open in router) and OMV uses 80
-
-
Check out this blog post: https://blog.linuxserver.io/20…#simplehtmlwebpagehosting
-
and don’t start another letsencrypt container
-
Check out this blog post: blog.linuxserver.io/2019/04/25…#simplehtmlwebpagehosting
Thanks! It works!
-
-
Thank you for answer. One question:
I think there will be a conflict with ports, my nextcloud/letsencrypt container uses 443 (and it's open in router) and OMV uses 80
Sorry about the delay...yea, forgot that OMV is using port 80 as well. I changed my own to something else before running the deployment, some time ago
I'm doing a lot of work these days, to implement Traefik Reverse Proxy on the Docker server. I want to use the latest Traefik v.2.1 , so it goes a little slow because of the recent changes.
My guess is that eventually Traefik will become a part of Docker, to enable reverse proxy to its users. It's complicated to implement and hard to grasp, for the normal user, but it will get there eventually.
We really need a stable logical reverse proxy to work with the Docker setup, as a native service configurable from an UI. Traefik is nice but changing rapidly.
I hope that you will get everything running to your liking.
-
I hope that you will get everything running to your liking.
Yup, thank you.
as a native service configurable from an UI
This will be great for n00bs like me
-
Thank you. I know that Nginx Reverse Proxy is working fine, and is easy to setup, but with Traefik you get autodiscovery of the containers you deploy, you just have to add the Traefik LABELS manually. In the perfect world, this should all happen automatically. It will get there I predict.
Of course, if you only have a few sites it might be overkill with Traefik, but again, it's a nice challenge to get it working. On Github you'll find new Traefik composer files daily to set this up more "easily".
Docker is amazing and makes life easy, compared to full-blown LAMP servers, etc.
Lets see
-
-
Docker is amazing and makes life easy
This is for sure. I struggled with LAMP/LEMP and always something get wrong. Now thanks to help from this great community and docker I have my basic needs covered> Nextcloud, media stuff etc.
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!