[Question] Hosting Multiple Sites (different domains) from One VPS

3 years ago by brownmustardminion to c/selfhost

Is it possible/practical to host multiple websites from the same VPS server?

I have a number of domains (for example): bilbobaggins.com, rx4free.com, mypersonalblog.com

I don’t get much traffic and I’m not interested in paying for separate servers for each domain. But I still want https certificates to work properly.

Now I’m familiar with setting up wildcard subdomains with traefik and letsencrypt. But can I do the same or similar with completely different domains such as listed above?

qazwsxedcrfv000 15 points 3 years ago

Typical web servers like Apache and Nginx support virtual hosts (aka server blocks in Nginx terminology)

path: 0 936179, hotness: undefined, score: 15, children: 1
noisy 1 point 3 years ago

I use virtual hosts frequently with Apache, it's definitely a good way to go.

path: 0 936179 1002318, hotness: undefined, score: 1, children: 0
flip 8 points 3 years ago

Yes, traefik can do that as well - just point your domains to the VPS and set up yout traefik rules. Traefik will properly create certificates and route accordingly.

path: 0 936309, hotness: undefined, score: 8, children: 1
gmartin 2 points 3 years ago path: 0 936309 955566, hotness: undefined, score: 2, children: 0
lemmy 3 points 3 years ago

Yep, what you're looking for is a reverse proxy. All the incoming traffic to the server goes though it, typically on TCP port 80 or 443. Reverse proxy then directs the traffic to all the backend apps. The backend apps can be literally anywhere else or even on the same server on a different port.

Traefik, Caddy, Nginx Proxy Manager, Linuxserver SWAG are the popular choices these days. See which one fits you best.

Edit: Overlooked you mentioning you are already using Traefik. Subdomain, domain, makes no difference. Just point the DNS record to your VPS and have Traefik direct it towards the correct port on the same server.

path: 0 964597, hotness: undefined, score: 3, children: 0
selfhost
selfhost

@lemmy.ml

login for more options
21175
570
255

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

  • No harassment
  • crossposts from c/Open Source & c/docker & related may be allowed, depending on context
  • Video Promoting is allowed if is within the topic.
  • No spamming.
  • Stay friendly.
  • Follow the lemmy.ml instance rules.
  • Tag your post. (Read under)

Important

  • Lemmy doesn't have tags yet, so mark it with [Question], [Help], [Project], [Other], [Promoting] or other you may think is appropriate. This is strongly encouraged!

Cross-posting

If you see a rule-breaker please DM the mods!

go to feed...