-
Notifications
You must be signed in to change notification settings - Fork 90
[Tutorial] Added guide to setting up Let's Encrypt SSL certificate on unique port on Hestia Control Panel with Netcup KVM #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vdbhb59
wants to merge
12
commits into
netcup-community:main
Choose a base branch
from
vdbhb59:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d51b71b
Added guide to get Let's Encrypt SSL certificate on unique port on He…
vdbhb59 cd3beae
Corrected typo
vdbhb59 53d682d
Corrected a sentence
vdbhb59 a1870bb
Few changes
vdbhb59 f40f537
Merge branch 'netcup-community:main' into main
vdbhb59 584094e
Updated as per review
vdbhb59 5da2cf7
Updated based on review
be2717a
Updated date to current day
2e9878b
CR year 25 & one more addition
f02fbef
No hyperlink please
a2c5954
Got what stecklars was speaking about tutorial url
3abfa7e
Updated with latest details
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
190 changes: 190 additions & 0 deletions
190
community-tutorials/hestiacp-add-lets-encrypt-unique-port/01-en.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,190 @@ | ||
| --- | ||
| title: Set up/proxy redirect, a Let's Encrypt SSL/HTTPS Certificate for a unique port with Hestia Control Panel on netcup. | ||
| description: Learn to set up or proxy redirect, a Let's Encrypt SSL/HTTPS Certificate on unique port (example 4545) with Hestia Control Panel on netcup KVM. | ||
| level: intermediate/advanced | ||
| updated_at: 2025-10-11 | ||
| slug: netcup-lets-encrypt-unique-port-hosting-using-hestia-control-panel | ||
| author_name: vdbhb59 | ||
| author_url: https://github.com/vdbhb59 | ||
| author_image: https://avatars.githubusercontent.com/u/60728004 | ||
| author_bio: Songs & Books 4ever | ||
| tags: [lets-encrypt, unique-port, reverse-proxy, ssl, https] | ||
| netcup_product_url: https://www.netcup.eu/bestellen/produkt.php?produkt=3691 | ||
| language: en | ||
| available_languages: en | ||
| --- | ||
|
|
||
| # Introduction | ||
|
|
||
| In this tutorial, I will guide you through the process of setting up a let's encrypt ssl/https certificate (reverse proxy) on a unique port other than 80/443, example **port:4545** on the root server for hosting using Hestia Control Panel (See installation URL given under prerequisites below). Hestia Control Panel is a popular open source web server control panel that simplifies the management of your website, email accounts, databases, and other hosting-related tasks. This tutorial is compatible with both VPS and Root Server offerings by netcup. | ||
|
|
||
| Assumptions: | ||
| * You already have a sub-domain setup and the requisite service installed at the specified http port (example - `http://sd1.domain.tld:4545`). | ||
| * You have the sub-domain setup with **SSL/HTTPS (443)** setup (example - `https://sd1.domain.tld`) | ||
| * You have bare minimum knowledge of terminal, web servers, vhosts, reverse proxy. | ||
|
|
||
| The reading time of this tutorial is about 35 minutes; implementation will take approximately 60-70 minutes. | ||
|
|
||
| ## Background | ||
|
|
||
| The objective of Let’s Encrypt and the ACME protocol is to make it possible to set up an HTTPS server and have it automatically obtain browser-trusted certificates without any human intervention. This is accomplished by running an ACME client on a web server. To know more, visit [Let's Encrypt](https://letsencrypt.org/how-it-works/). This also forms a part for use in Nginx reverse proxy configuration. | ||
|
|
||
| [Forgejo](https://forgejo.org/) is a self-hosted lightweight software forge (simple software project management). Easy to install and low maintenance, it just does the job. | ||
|
|
||
| In the world of open-source software, the story of how a project is governed is often as important as the code itself. Forgejo is a powerful testament to this fact. It is a “soft fork” of [Gitea](https://about.gitea.com/), created by a community of users and contributors to ensure that the project’s future remains in the hands of a non-profit, community-driven organization. | ||
|
|
||
| Born out of concerns following the creation of a for-profit company to manage Gitea, Forgejo’s mission is to be a truly free and open-source software (FOSS) forge, managed under the stewardship of the Codeberg e.V. non-profit. It is technically very similar to Gitea, but philosophically, it represents a commitment to community ownership and non-commercial governance. | ||
|
|
||
| Since Forgejo by default/design runs on port 4545 and many other projects also default to port 4545, I chose a different port (example 4545 here). This helps me keep it running in the background without conflicting with other applications. This was necessary for 2 more reasons: | ||
|
|
||
| * Clean url everytime | ||
| Example instead having to type or visit `https://git.example.com:4545` every time, I will have a cleaner url as `https://git.example.com`. | ||
| * Issue an HTTPS/SSL/TLS enabled URL and enjoy the higher level of security. | ||
| Visitors & users of my site would also know they are safe. | ||
|
|
||
| # Prerequisites | ||
|
|
||
| - A server from netcup with latest Ubuntu 20.04/22.04/LTS; Debian 10/11/12/LTS or later installed (see the below URL) - use minimal mode of installation, also called clean installation. [Installation Tutorial](https://community.netcup.com/en/tutorials/netcup-root-server-hosting-using-hestia-control-panel) | ||
| - A registered domain name | ||
| - Access to your server | ||
|
|
||
| # Step 1: Update your system | ||
|
|
||
| Before we begin, it's essential to ensure that your system is up-to-date. Log in to your server via SSH as the root user and run the following command: | ||
|
|
||
| For Ubuntu/Debian: | ||
|
|
||
| ``` | ||
| apt update && apt upgrade -y | ||
| ``` | ||
|
|
||
| # Step 2: Add the necessary changes to the service (example git) | ||
|
|
||
| ``` | ||
| username@serverip:port | ||
| ``` | ||
|
|
||
| I created a normal subdomain at normal 80/443 ports with LE SSL generated. | ||
| Then in the git app.ini (**/etc/git/app.in**) file, added this under **[server]** | ||
|
|
||
| ``` | ||
| nano /etc/git/app.ini | ||
| -------------- | ||
| [server] | ||
| ENABLE_ACME = enable | ||
| HTTPS_PORT = 4545 ssl | ||
| ROOT_URL = https://git.domain.tld | ||
| -------------- **(save changes to the file by typing CTRL+X simultaneously)** | ||
| CTRL+X | ||
| Y | ||
| Enter | ||
| ``` | ||
|
|
||
| Then under nginx.conf (**$HESTIADATA\conf\web\git.domain.tld\nginx.conf**) I added | ||
|
|
||
| ``` | ||
| nano /$HESTIADATA\conf\web\git.domain.tld\nginx.conf | ||
| -------------- | ||
| location / { | ||
| client_max_body_size 4096M; | ||
| proxy_pass http://localhost:4545; | ||
| proxy_set_header Connection $http_connection; | ||
| proxy_set_header Upgrade $http_upgrade; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Forwarded-Proto $scheme; | ||
| -------------- **(save via)** | ||
| CTRL+X | ||
| Y | ||
| Enter | ||
| ``` | ||
|
|
||
| Then under apache2.conf (**$HESTIADATA\conf\web\git.domain.tld\apach2.conf**) I added | ||
|
|
||
| ``` | ||
| nano /$HESTIADATA\conf\web\git.domain.tld\apache2.conf | ||
| -------------- | ||
| ProxyPreserveHost On | ||
| ProxyRequests off | ||
| AllowEncodedSlashes NoDecode | ||
| ProxyPass / http://localhost:4545/ nocanon | ||
| -------------- **(save via)** | ||
| CTRL+X | ||
| Y | ||
| Enter | ||
| ``` | ||
|
|
||
| Then under apache2.ssl.conf (**$HESTIADATA\conf\web\git.domain.tld\apache2.ssl.conf**) I added | ||
|
|
||
| ``` | ||
| nano /$HESTIADATA\conf\web\git.domain.tld\apach2.ssl.conf | ||
| -------------- | ||
| < VirtualHost git.domain.tld:8443 https > | ||
| ***************************** | ||
| ***************************** | ||
| ProxyPreserveHost On | ||
| ProxyRequests off | ||
| AllowEncodedSlashes NoDecode | ||
| ProxyPass / http://localhost:4545/ nocanon | ||
| -------------- **(save via)** | ||
| CTRL+X | ||
| Y | ||
| Enter | ||
| ``` | ||
|
|
||
| I also enabled the following to ensure the proxy works: | ||
|
|
||
| ``` | ||
| a2enmod proxy | ||
| a2enmod proxy_http | ||
| a2enmod proxy_balancer | ||
| a2enmod proxy_wstunnel | ||
| systemctl restart apache2 | ||
|
vdbhb59 marked this conversation as resolved.
|
||
| ``` | ||
|
|
||
| Then I restarted all services | ||
|
|
||
| ``` | ||
| systemctl restart apache2 | ||
| systemctl restart nginx | ||
| systemctl start git.service | ||
| ``` | ||
|
|
||
| I got the help from these: | ||
|
|
||
| [APache SSL Long Record Error](https://stackoverflow.com/a/42206383) | ||
|
|
||
| [Let's Encrypt SSL Certificate](https://www.reddit.com/r/forgejo/comments/1ar9j72/comment/kqudf1t/) | ||
|
|
||
| [Gitea Reverse Proxy - Apache HTTPD](https://docs.gitea.com/administration/reverse-proxies#apache-httpd) | ||
|
|
||
| [Gitea Reverse Proxy - General Conf](https://docs.gitea.com/administration/reverse-proxies#general-configuration) | ||
|
|
||
| [Gitea Reverse Proxy - NGINX](https://docs.gitea.com/administration/reverse-proxies#nginx) | ||
|
|
||
| # Conclusion | ||
|
|
||
| Awesome! You've successfully set up a let's encrypt certificate on a unique port other than the usual ones used 443/8443. Specifially port 3000 used by forge systems (gitea, forgejo, etc.,) | ||
| # Licence | ||
|
|
||
| [MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE) | ||
|
|
||
| Copyright (c) 2025 netcup | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
|
||
| # Contributor's Certificate of Origin | ||
| By making a contribution to this project, I certify that: | ||
|
|
||
| 1) The contribution was created in whole or in part by me and I have the right to submit it under the licence indicated in the file; or | ||
|
|
||
| 2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate licence and I have the right under that licence to submit that work with modifications, whether created in whole or in part by me, under the same licence (unless I am permitted to submit under a different licence), as indicated in the file; or | ||
|
|
||
| 3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. | ||
|
|
||
| 4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the licence(s) involved. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.