this post was submitted on 22 Mar 2026
7 points (81.8% liked)

Selfhosted

58044 readers
759 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

  7. No low-effort posts. This is subjective and will largely be determined by the community member reports.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

I made a Docker container of a website that's difficult to deploy, and I can reliably deploy it on localhost on my personal machine. The container sets up an Apache server with all the files and config to run the website.

However, the story is different on my VPS running Ubuntu and Apache. I have two other websites running on the same VPS, each with different domains and running directly on the host without Docker. When I deploy the dockerized website, I can't access that site. I opened ports on UFW. The Docker container sets the site to run on port 8000, and I tried running a reverse proxy on just that site with Apache by defining a config pointing towards the internal Docker IP on port 8000, but no luck.

Now I'm thinking of running a reverse proxy, but I haven't found any guides covering my situation: routing websites on both the host machine and through Docker. nginx-proxy looks to cover only Docker containers, and the Apache reverse proxy couldn't access the Docker container.

What are my options here? I plan to dockerize everything eventually, but that will be sometime in the future and not right away.

you are viewing a single comment's thread
view the rest of the comments
[–] bestbakerycookie@lemmy.wtf 1 points 1 week ago* (last edited 1 week ago) (1 children)

Thanks for the reply. I can see that the port is bound and I enabled the ports in UFW. I have a hybrid setup where the other two websites are run directly on the host without Docker and now I'm introducing a Docker container for the new deployment. All sites are running on the same ports with different domains, but the Docker one is the one with an issue. How can I have the reverse proxy acknowledge both the site on the Docker container and the sites run natively? Should I set different ports in the Apache site configs then use those ports in the reverse proxy?

[–] mhzawadi@lemmy.horwood.cloud 1 points 1 week ago

Ok, the docker container will need to be on a different port to your proxy Something like 127.0.0.1:8080:80

In your proxy, the upstream will be 127.0.0.1:8080.

This should give you what you need