# Change port 443 and 80

**URL:** <https://help.nextcloud.com/t/change-port-443-and-80/13742>\
**Category:** ℹ️ Support\
**Tags:** linux, apache\
**Created:** [June 7, 2017, 6:10pm UTC](https://help.nextcloud.com/t/change-port-443-and-80/13742 "2017-06-07T18:10:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eazy](https://help.nextcloud.com/letter_avatar/eazy/32/5_5575768a8748004e209b776fc1b2916d.png) [@Eazy](https://help.nextcloud.com/u/Eazy)\
**Post date:** [June 7, 2017, 6:10pm UTC](https://help.nextcloud.com/t/change-port-443-and-80/13742/1 "2017-06-07T18:10:44Z")

</div>

Hi!  
I need to change port 80 and 443 to something else for Nextcloud (Apache) and I just need to have my own solution confirmed or corrected.

1. I change port 443 to 8443 in /etc/apache2/sites-available/default-ssl.conf
2. I change port 80 to 880 in /etc/apache2/sites-available/000-default.conf
3. I change to ‘overwrite.cli.url’ =\> [https://exampel.ddns.com:8443/nextcloud](https://exampel.ddns.com:8443/nextcloud) in /var/www/nextcloud/config/config.php
4. Open port 880 and 8443 in my router

My address to my Nextcloud will then be [https://exampel.ddns.com:8443/nextcloud](https://exampel.ddns.com:8443/nextcloud)

Does this looks right? I know this really is a question about Apache aside from the “‘overwrite.cli.url’ =\>”-bit but I hope you could confirm or correct my thinking if I’m very nice 🙂

---

<div class="post-metadata">

**Author:** ![joergschulz](https://help.nextcloud.com/user_avatar/help.nextcloud.com/joergschulz/32/55349_2.png) [@joergschulz](https://help.nextcloud.com/u/joergschulz)\
**Post date:** [June 7, 2017, 9:03pm UTC](https://help.nextcloud.com/t/change-port-443-and-80/13742/2 "2017-06-07T21:03:43Z")

</div>

you will have to change the port in apache.conf as well  
listen 8443

---

<div class="post-metadata">

**Author:** ![Eazy](https://help.nextcloud.com/letter_avatar/eazy/32/5_5575768a8748004e209b776fc1b2916d.png) [@Eazy](https://help.nextcloud.com/u/Eazy)\
**Post date:** [June 7, 2017, 9:46pm UTC](https://help.nextcloud.com/t/change-port-443-and-80/13742/3 "2017-06-07T21:46:54Z")

</div>

Thank you for your answer!  
But the rest looks right?

---

<div class="post-metadata">

**Author:** ![Eazy](https://help.nextcloud.com/letter_avatar/eazy/32/5_5575768a8748004e209b776fc1b2916d.png) [@Eazy](https://help.nextcloud.com/u/Eazy)\
**Post date:** [June 8, 2017, 7:56pm UTC](https://help.nextcloud.com/t/change-port-443-and-80/13742/4 "2017-06-08T19:56:25Z")

</div>

I could not understand exactly where I should add the port number in apache. I have a apache2.conf but dont know where to set the port number. Maybe at the end of “ServerName [example.ddns.com](http://example.ddns.com)” to “ServerName [example.ddns.com:8443](http://example.ddns.com:8443)”?

In the apche2.conf there are referrals “ports.conf” and in that conf are port 80 and 443 set. Perhaps I need to change in ports.conf instead of apache2.conf?

---

<div class="post-metadata">

**Author:** ![Eazy](https://help.nextcloud.com/letter_avatar/eazy/32/5_5575768a8748004e209b776fc1b2916d.png) [@Eazy](https://help.nextcloud.com/u/Eazy)\
**Post date:** [June 11, 2017, 6:42pm UTC](https://help.nextcloud.com/t/change-port-443-and-80/13742/5 "2017-06-11T18:42:47Z")

</div>

I guess having your own cloud is not something for newbes. Read this how you will. i will stop asking questions here…

---

<div class="post-metadata">

**Author:** ![JasonBayton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonbayton/32/297_2.png) [@JasonBayton](https://help.nextcloud.com/u/JasonBayton)\
**Post date:** [June 11, 2017, 8:56pm UTC](https://help.nextcloud.com/t/change-port-443-and-80/13742/6 "2017-06-11T20:56:51Z")

</div>

Unfortunately this is a forum supported in large by the community, so SLAs on responses can’t be offered ☹

What you’re asking isn’t a Nextcloud question, it’s help with Apache. That said:

1. Edit `/etc/apache2/ports.conf`  
a. Change the port numbers as required or add new
2. Edit `/etc/apache2/sites-available/yournextcloud.conf`  
a. Change 80/443 there to the ports in `<VirtualHost *:80>` (or 443) to what you specified in 1a.
3. Restart Apache: `sudo service apache2 restart`

---

<div class="post-metadata">

**Author:** ![Cp\_Gunny](https://help.nextcloud.com/user_avatar/help.nextcloud.com/cp_gunny/32/55463_2.png) [@Cp\_Gunny](https://help.nextcloud.com/u/Cp_Gunny)\
**Post date:** [October 24, 2023, 4:25am UTC](https://help.nextcloud.com/t/change-port-443-and-80/13742/7 "2023-10-24T04:25:57Z")

</div>

Hi!  
to change port 80 and 443 to Nextcloud (Apache) and you need to

1. I change port 443 to 8443 in /etc/apache2/sites-available/default-ssl.conf
2. I change port 80 to 880 in /etc/apache2/sites-available/000-default.conf  
3.I change port 80 to 880 in /etc/apache2/sites-enabled/nextcloud.conf  
4.I change port 443 to 8443 in /etc/apache2/sites-enabled/nextcloud.conf
3. service apache2 restart

to work

---

<div class="post-metadata">

**Author:** ![SignedAdam](https://help.nextcloud.com/user_avatar/help.nextcloud.com/signedadam/32/58919_2.png) [@SignedAdam](https://help.nextcloud.com/u/SignedAdam)\
**Post date:** [February 13, 2024, 9:15am UTC](https://help.nextcloud.com/t/change-port-443-and-80/13742/8 "2024-02-13T09:15:13Z")

</div>

both @JasonBayton and @Cp_Gunny steps need to be followed for this to work, i partly did some of these changes in the winadmin “apache webserver”

some of us dont just want to run nextcloud, or have more than one apache service running on our network, its a waste of resources,

feedback to nextcloud devs, please higher the amount of login attempts for winadmin, 2 and then a ban that lasts one whole hour isn’t very helpful when youre trying to set all this up

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [January 16, 2025, 9:24am UTC](https://help.nextcloud.com/t/change-port-443-and-80/13742/9 "2025-01-16T09:24:46Z")

</div>


