# 2.) Changing ports

In order to get the port 80 and 443 free for Nginx later, we need to change the port of the Nextcloud apache server.

  
\- open an ssh terminal of your joice (like putty for Windows) and connect to the pi via ssh

\- type in:

```shell
sudo nano /etc/apache2/ports.conf
```

[![NCPssh-ports1.PNG](https://bookstack.borghoff.ddnss.de/uploads/images/gallery/2021-04/scaled-1680-/ywnY6UAH6SFg46mn-ncpssh-ports1.PNG)](https://bookstack.borghoff.ddnss.de/uploads/images/gallery/2021-04/ywnY6UAH6SFg46mn-ncpssh-ports1.PNG)

[![NCPssh-ports2.PNG](https://bookstack.borghoff.ddnss.de/uploads/images/gallery/2021-04/scaled-1680-/P1z44ohOj6QY7K0k-ncpssh-ports2.PNG)](https://bookstack.borghoff.ddnss.de/uploads/images/gallery/2021-04/P1z44ohOj6QY7K0k-ncpssh-ports2.PNG)

\- look for port 80 ; change it to 8080

\- look for port 443 ; change it to 4430

\- save with STRG+O and exit out with STRG+X

\- type in :

```shell
sudo nano /etc/apache2/sites-available/000-default.conf
```

[![NCPssh-ports3.PNG](https://bookstack.borghoff.ddnss.de/uploads/images/gallery/2021-04/scaled-1680-/rg9v6GPphSqckgtQ-ncpssh-ports3.PNG)](https://bookstack.borghoff.ddnss.de/uploads/images/gallery/2021-04/rg9v6GPphSqckgtQ-ncpssh-ports3.PNG)

[![NCPssh-ports4.PNG](https://bookstack.borghoff.ddnss.de/uploads/images/gallery/2021-04/scaled-1680-/bm5y1H4ZaeEJYUKg-ncpssh-ports4.PNG)](https://bookstack.borghoff.ddnss.de/uploads/images/gallery/2021-04/bm5y1H4ZaeEJYUKg-ncpssh-ports4.PNG)

\- search for virtualhost ; change ist to 8080

\- type in :

```shell
sudo nano /etc/apache2/sites-available/nextcloud.conf
```

[![NCPssh-ports5.PNG](https://bookstack.borghoff.ddnss.de/uploads/images/gallery/2021-04/scaled-1680-/OQEfXg2EFBM4VzJm-ncpssh-ports5.PNG)](https://bookstack.borghoff.ddnss.de/uploads/images/gallery/2021-04/OQEfXg2EFBM4VzJm-ncpssh-ports5.PNG)

[![NCPssh-ports6.PNG](https://bookstack.borghoff.ddnss.de/uploads/images/gallery/2021-04/scaled-1680-/YaiqG9XcyDQjCqGQ-ncpssh-ports6.PNG)](https://bookstack.borghoff.ddnss.de/uploads/images/gallery/2021-04/YaiqG9XcyDQjCqGQ-ncpssh-ports6.PNG)

\- search for virtualhost ; change it to 4430

\- save with STRG+O and exit out with STRG+X

\- now your Nextloud web page will be accessable under port 8080 and 4430 for ssl