# Difficulty installing on vm that includes CPanel and Apache

**URL:** https://meta.discourse.org/t/difficulty-installing-on-vm-that-includes-cpanel-and-apache/358157
**Category:** Self-hosting
**Tags:** unsupported-install
**Created:** [March 20, 2025, 2:25pm UTC](https://meta.discourse.org/t/difficulty-installing-on-vm-that-includes-cpanel-and-apache/358157 "2025-03-20T14:25:45Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Gustavo\_Rip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gustavo_rip/32/489281_2.png) [@Gustavo\_Rip](https://meta.discourse.org/u/Gustavo_Rip)
#### Post date: [March 20, 2025, 2:25pm UTC](https://meta.discourse.org/t/difficulty-installing-on-vm-that-includes-cpanel-and-apache/358157/1 "2025-03-20T14:25:45Z")

</div>

**Hi everyone!**

\*\*This is my first post. \*\*

**I’m a new Discourse user coming from phpBB.**  
**Two weeks ago, I installed Discourse in a Docker container using Nginx, since Apache uses ports 80 and 443 by default. I carefully followed the steps outlined in the installation guides and the Nginx multisite configuration.**

\*\*I was able to run and use the forum for a week, only occasionally logging in to familiarize myself with the platform. When I asked one of the users to register and test it, the forum crashed the next day. The browser displayed the message: “The software powering this discussion forum encountered an unexpected problem.” I couldn’t fix it, so I reinstalled the entire forum from scratch and then restored the threads from the last available backup. This was last Thursday. After all this, the forum was back up and running. Now, it’s back up again with a 502 Bad Gateway Nginx error. I went straight for the rebuild app and it crashed again with the error:

`Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 580 exit 1>`.

This same thing happened over and over again last week and it led me to reinstall everything from scratch. The forum is practically inactive because I haven’t made it public yet. I’m scared of the idea that if it keeps crashing without activity, what could happen with a larger user group? Run these commands: ./launcher enter app\*\*

```plaintext
**cd /var/www/discourse**
 **su discourse -c 'bundle exec rake db:migrate'**

```

\*\*And in the response, I see this that caught my attention:

`connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: the database system is starting up**`

**I tried restarting Postgress manually and running the rebuild again, but the process was interrupted again with this error message:**

```plaintext
**FAILED**
 **--------------------**
**Pups::ExecError: if [-f /root/install_postgres]; then**
 **/root/install_postgres && rm -f /root/install_postgres**
**elif [-e /shared/postgres_run/.s.PGSQL.5432]; then**
 **socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1**
 **fi**
 **failed with return #<Process::Status: pid 18 exit 1>**
 **Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'**
**exec failed with the params {"tag"=>"db", "cmd"=>"if [-f /root/install_postgres]; then\n /root/install_postgres && rm -f /root/install_postgres\nelif [-e /shared/postgres_run/.s.PGSQL.5432]; then\n socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container exit ; 1\nfi\n"}**
 **bootstrap failed with exit code 1**

```

**I’m not really an experienced user to identify the error, but I suspect that Postgres will break at some point. This led me to restart everything and start over last week, but I don’t think this is a common or healthy practice for anyone.**

**Discourse is running on a server with 4 cores, 6GB of RAM, and 180GB of disk space. I’m currently only running this installation of Discourse, so from what I understand, I’m not limited by hardware.**

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 20, 2025, 2:39pm UTC](https://meta.discourse.org/t/difficulty-installing-on-vm-that-includes-cpanel-and-apache/358157/3 "2025-03-20T14:39:09Z")

</div>

Welcome, @Gustavo_Rip ! Sorry you’re having trouble.

> [@Gustavo\_Rip](#):
>
> I installed Discourse in a Docker container using Nginx, since Apache uses ports 80 and 443 by default.

Did you do a [standard install](https://meta.discourse.org/t/142537?silent=true)? WIth a [standard install](https://meta.discourse.org/t/142537?silent=true), you need neither Nginx, nor Apache (and both use ports 80 and 443 by default). If you have either of those installed, you should remove them before starting.

Do you need multisite? Even if you do, I would recommend first doing a [standard install](https://meta.discourse.org/t/142537?silent=true), and then go about following this guide: [Setup Multisite Configuration with Let’s Encrypt and no Reverse Proxy](https://meta.discourse.org/t/setup-multisite-configuration-with-lets-encrypt-and-no-reverse-proxy/175285). I helped someone with it yesterday, and it looks like if you use the correct hostnames and don’t use Cloudflare with orange cloud it works just fine.

---

<div class="post-metadata">

### Author: ![Gustavo\_Rip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gustavo_rip/32/489281_2.png) [@Gustavo\_Rip](https://meta.discourse.org/u/Gustavo_Rip)
#### Post date: [March 20, 2025, 2:55pm UTC](https://meta.discourse.org/t/difficulty-installing-on-vm-that-includes-cpanel-and-apache/358157/4 "2025-03-20T14:55:58Z")

</div>

> [@pfaffman](#):
>
> Welcome, @Gustavo_Rip ! Sorry you’re having trouble.

Thanks pfaffmann!!

Fortunately, I’m not one of those people who gives up easily, although these subsequent problems worry me, especially since I’m not 100% familiar with this platform.

By default, my CloudServer has Apache installed, and if I remove it, it causes problems with CPanel and other features. I tried it during the first installation because I read that nginx was much better and faster, but I had the issues I mentioned. Therefore, I reinstalled the OS on the server and started over, following this recommendation:

> [@Run other websites on the same machine as Discourse](https://meta.discourse.org/t/run-other-websites-on-the-same-machine-as-discourse/17247):
>
> @pfaffman edited this heavily 2022.02.24. Blame me if it’s broken. If you want to run other websites on the same machine as Discourse, you need to set up an extra NGINX or HAProxy proxy in front of the Docker container. NOTE: This is for advanced admins This guide assumes you already have Discourse working - if you don’t, it may be hard to tell whether or not the configuration is working. You cannot use ./discourse-setup to set up Discourse if another server is using port 80 or 443. You will…

It’s not like I have multiple sites, at least not yet, because my CloudServer allows up to 5 accounts.

As for the standard installation, I followed all the steps to install Docker, Discourse, Certbot, and download the Let’s Encrypt certificates, but when I ran discourse-setup, I had to perform the manual configuration following the link above and configuring manually app.yml file to perform the rebuild.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 20, 2025, 3:42pm UTC](https://meta.discourse.org/t/difficulty-installing-on-vm-that-includes-cpanel-and-apache/358157/5 "2025-03-20T15:42:40Z")

</div>

> [@Gustavo\_Rip](#):
>
> By default, my CloudServer has Apache installed, and if I remove it, it causes problems with CPanel and other features

You really don’t want CPanel. It adds nothing and makes it much harder to install Discourse. And if you have it, you can’t follow the NGinx instructions since Apache is already in the way.

If you can remove Apache and CPanel, do that. If you can’t, I’d recommend a different hosting service.

Actually, what you have might not work at all, can you run

```
 docker run hello-world

```

---

<div class="post-metadata">

### Author: ![Gustavo\_Rip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gustavo_rip/32/489281_2.png) [@Gustavo\_Rip](https://meta.discourse.org/u/Gustavo_Rip)
#### Post date: [March 20, 2025, 4:08pm UTC](https://meta.discourse.org/t/difficulty-installing-on-vm-that-includes-cpanel-and-apache/358157/6 "2025-03-20T16:08:50Z")

</div>

> [@pfaffman](#):
>
> If you can remove Apache and CPanel, do that. If you can’t, I’d recommend a different hosting service.

Which hosting service do you recommend? or which is the most used for Discourse instalations?

> [@pfaffman](#):
>
> `docker run hello-world`

Yes! this is the message:

```plaintext
Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 20, 2025, 4:15pm UTC](https://meta.discourse.org/t/difficulty-installing-on-vm-that-includes-cpanel-and-apache/358157/7 "2025-03-20T16:15:25Z")

</div>

> [@Gustavo\_Rip](#):
>
> Which hosting service do you recommend?

Anything that doesn’t install CPanel. There are several topics about recommended ones. Digital Ocean is easy.

> [@Gustavo\_Rip](#):
>
> Yes!

Ah. Then if you could just get rid of Apache and CPanel, you’d been in good shape. This seems like the easiest way forward from where you are.

The other way to go is keep CPanel and contrive to get your existing Apache to be a reverse proxy. You’ll be on your own, though, as there are too many install-specific holes to fall in for people to be of much help here.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [March 20, 2025, 4:22pm UTC](https://meta.discourse.org/t/difficulty-installing-on-vm-that-includes-cpanel-and-apache/358157/8 "2025-03-20T16:22:16Z")

</div>

> [@Gustavo\_Rip](#):
>
> Which hosting service do you recommend?

Lot of suggestions here:

> [@Recommended Hosting Providers for Self Hosters](https://meta.discourse.org/t/recommended-hosting-providers-for-self-hosters/79562):
>
> This guide is intended for people who are not system administrators who just want to make Discourse work. This is a list of cloud hosting services that are believed to be reliable and easy enough for a novice to get up and running with as little fiddling as possible. You should be able to create an account, and a server on which to run your Discourse instance and still be able to pull the job off in very close to 30 minutes. I have installed Discourse on each of these, received an email from Di…

---

<div class="post-metadata">

### Author: ![Gustavo\_Rip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gustavo_rip/32/489281_2.png) [@Gustavo\_Rip](https://meta.discourse.org/u/Gustavo_Rip)
#### Post date: [March 20, 2025, 4:25pm UTC](https://meta.discourse.org/t/difficulty-installing-on-vm-that-includes-cpanel-and-apache/358157/9 "2025-03-20T16:25:23Z")

</div>

Thanks @pfaffman for your time and responses!!

I don’t think it’s likely I’ll remove Apache and CPanel. Perhaps my cloud server provider can modify Apache’s ports so it doesn’t use the same ones as Discourse, thus eliminating nginx, or modify CPanel for Ferozo or another service. I don’t know, but I’ll ask.

Best regards!
