Skip to content

Commit

Permalink
Merge pull request #170 from vdbhb59/patch-2
Browse files Browse the repository at this point in the history
Set up a root web server using Hestia Control Panel & update VPS Web Hosting tutorial
  • Loading branch information
stecklars authored Nov 20, 2024
2 parents 964e4f6 + c30d812 commit 43c5016
Show file tree
Hide file tree
Showing 8 changed files with 218 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
---
title: Set Up a Web Server Using Hestia Control Panel on netcup
description: Learn how to set up a Root Server for hosting using Hestia Control Panel on netcup.
level: beginner
updated_at: 2024-11-18
slug: netcup-root-server-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: [root, hosting, hestia-control-panel, netcup, debian, ubuntu, LTS-only]
netcup_product_url: https://www.netcup.com/en/server/root-server/rs-1000-g11-iv-12m
language: en
available_languages: en
---

# Introduction

In this tutorial, we will guide you through the process of setting up a netcup Root Server for hosting using Hestia Control Panel. 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.

The reading time of this tutorial is about 15 minutes; implementation will take approximately 45 minutes.

# Prerequisites

- A Root Server from netcup with latest Ubuntu 20.04/22.04 (LTS); Debian 10/11/12 or later installed (see the below URL) - use minimal mode of installation, also called clean installation. [Requirement Details](https://hestiacp.com/docs/introduction/getting-started.html#requirements)
- Please note latest Hestia Control Panel only supports the latest versions of the above OS. To know more visit:
[Supported OS](https://hestiacp.com/docs/introduction/getting-started.html#supported-operating-systems)
- A registered domain name (optional)
- Root 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: Install Hestia Control Panel

To install Hestia Control Panel, you'll first need to install the installation script. Run the following commands to download and to execute the installation script:

```
cd ~ && wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh && bash hst-install.sh
```
> **Info**
> If the download fails due to an SSL validation error, please be sure you've installed the ca-certificate package on your system - you can do this with the following command: `apt-get update && apt-get install ca-certificates`
> **Info**
> To install with custom commands, use the script generator: [Script Generator](https://gabizz.github.io/hestiacp-scriptline-generator/)
Possible options to use in the command are:
```
-a, --apache Install Apache [yes | no] default: yes
-w, --phpfpm Install PHP-FPM [yes | no] default: yes
-o, --multiphp Install MultiPHP [yes | no] default: no
-v, --vsftpd Install VSFTPD [yes | no] default: yes
-j, --proftpd Install ProFTPD [yes | no] default: no
-k, --named Install BIND [yes | no] default: yes
-m, --mysql Install MariaDB [yes | no] default: yes
-M, --mysql8 Install Mysql8 [yes | no] default: no
-g, --postgresql Install PostgreSQL [yes | no] default: no
-x, --exim Install Exim [yes | no] default: yes
-z, --dovecot Install Dovecot [yes | no] default: yes
-Z, --sieve Install Sieve [yes | no] default: no
-c, --clamav Install ClamAV [yes | no] default: yes
-t, --spamassassin Install SpamAssassin [yes | no] default: yes
-i, --iptables Install Iptables [yes | no] default: yes
-b, --fail2ban Install Fail2ban [yes | no] default: yes
-q, --quota Filesystem Quota [yes | no] default: no
-d, --api Activate API [yes | no] default: yes
-r, --port Change Backend Port default: 8083
-l, --lang Default language default: en
-y, --interactive Interactive install [yes | no] default: yes
-s, --hostname Set hostname
-e, --email Set admin email
-p, --password Set admin password
-D, --with-debs Path to Hestia debs
-f, --force Force installation
-h, --help Print this help
```

An example of an updated command to run the script:
```
cd ~ && wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh && bash hst-install.sh --apache yes --phpfpm yes --multiphp yes --vsftpd yes --port '8083' --hostname 'DOMAIN-HERE' --email 'EMAIL-HERE' --password 'PASSWORD-HERE' --lang 'en' --force
```

Follow the on-screen instructions to complete the installation. The installation process may take some time. Once it's complete, the Hestia Control Panel will be installed on your system.

# Step 3: Configure Hestia Control Panel

After the installation is complete, you can access Hestia via your browser. Open your browser and navigate to:

```
https://your_server_ip:8083
```

![Hestia Control Panel Login](images/Login_Page.png)

Replace "your_server_ip" with the IP address of your server. You'll encounter a security warning since the SSL certificate is self-signed. Proceed to the website and log in with the username and password that were displayed at the end of the script run.

Upon logging in, you'll be presented with the dashboard where you can view and configure the panel as per your needs.

![Panel Dashboard](images/Control_Panel_Homepage.png)

# Step 4: Create a new user (regular)

On the dashboard, click the "Add User" button; fill out the fields; click the "Save" button in the top right.

To switch to the new user, hover over the user you want to login as; click the login as icon (`-]`) on the right of the user’s name and email; you are now logged in as the user. As such, any action you perform will be done as this user.

**Info**
Never run a web or mail domain with the admin user - by default, the admin user has elevated privileges. This can pose a security threat to your server!

# Step 5: Set up your domain

Navigate to the "Web" tab and click the "+ Add Web Domain" button, then enter your domain information.
Example: `exampledomain.com`

After creating a new account, you'll need to update your domain's nameservers to point to your server. This process varies depending on your domain registrar, so consult their documentation for instructions.

# Step 6: Create DNS zone, email accounts & databases

Click on the box labeled "DNS" & fill in the required details. A minimum of 2 name servers are necessary for redundancy.

![DNS Setup](images/DNS_Setup.png)

With your domain set up, you can now create email accounts and databases for your website. To create an email account, click on the box labeled "MAIL".

![MAIL Setup](images/MAIL_Setup.png)

To create a database, click on the box labeled "DB".

![Database Setup](images/DB_Setup.png)

# Step 6: Upload your website files

To upload your website files, you can use the File Manager in the Panel or an FTP client such as FileZilla. If using the File Manager, click on the File Manager icon on the right top side and upload your files to the "public_html" directory under WEB -> domain_name_folder -> public_html.

![Upload Files](images/Upload_Files.png)

If using an FTP client, you'll need to create an FTP account in the Panel first. Click on the "WEB" icon -> "domain name (edit domain)" -> "Advanced Options" -> "Additional FTP account(s)" -> fill in the username, password and the default path & click "Save" to create a new account, then use the provided credentials to connect and upload your files.

# Step 7: Enable two-factor authentication (2FA) for the admin user

[Documentation](https://hestiacp.com/docs/user-guide/account.html#two-factor-authentication-2fa)

Since the admin user has full control on the server, as well as elevated privileges, it is highly recommended that you enable 2FA on this account. To access your account settings, click the user button in the top right. Note that you might need to switch back to the admin user first, using the "Arrow up" button in the top right.

- In your account settings, check the box labeled "Enable two-factor authentication".
- Click the "Save" button in the top right.
- Scan the QR code using an authentication app, for example "Google Authenticator".
- Save your Account Recovery Code somewhere safe, in case you lose access to your authenticator.

To secure your account further check out the following tutorial (applies to all server setups): [Secure Linux Server](https://community.netcup.com/en/tutorials/first-steps-to-protect-your-linux-server-against-common-attacks)

# Conclusion

Awesome! You've successfully set up a netcup Root Server for hosting using Hestia Control Panel. You can now manage your websites, emails, and databases through the userfriendly interface. Remember to keep your server and Panel updated to ensure consistent security and performance.

# Licence

[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)

Copyright (c) 2024 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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 34 additions & 7 deletions community-tutorials/vps-web-hosting-using-cpanel/01-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,24 @@ The reading time of this tutorial is about 10 minutes; implementation will take

# Prerequisites

- A server from netcup with CentOS 7 or later or Ubuntu 18.04 or later installed
- A server from netcup with AlmaLinux, CloudLinux, RockyLinux or Ubuntu 22.04 or later installed (see the below URL) - use minimal mode of installation, also called clean installation.
```
https://docs.cpanel.net/installation-guide/system-requirements/
```

- Older OS verions like CentOS 7 is still allowed with forced installation in the script or directly via installing of specific verion. See:
```
https://support.cpanel.net/hc/en-us/articles/360052251053-How-to-Install-a-Specific-Version-of-cPanel-WHM
```
```
--force — Force installation on an unrecommended configuration.
```

- Please note latest cPanel/WHM only supports the latest versions of the above OS. To know more visit:
```
https://support.cpanel.net/hc/en-us/articles/1500001216582-What-operating-systems-are-supported-by-cPanel
```

- A registered domain name (optional)
- Root access to your server

Expand All @@ -44,17 +61,27 @@ apt update && apt upgrade -y

# Step 2: Install cPanel

To install cPanel, you'll first need to install the cPanel & WHM installation script. Run the following commands:
To install cPanel, you'll first need to install the cPanel & WHM installation script. Run the following commands to download and to execute the installation script:

```bash
cd /home
sudo curl -o latest -L https://securedownloads.cpanel.net/latest
cd ~ && curl -o latest -L https://securedownloads.cpanel.net/latest && sudo sh latest
```

Now, execute the installation script:
The newer cPanel versions default to fast installation mode. It is recommended to disable the fast mode based on your requirements. You can use the options provided here:
```
https://docs.cpanel.net/installation-guide/customize-your-installation/
```

```bash
sudo sh latest
A few examples to use with the command are:
```
--skip-wptoolkit — Skip the automatic installation of WP Toolkit.
--skip-cloudlinux — Skip the automatic CloudLinux conversion process even if a license exists.
--force — Force installation on an unrecommended configuration.
```

Updated command to run the script:
```
cd ~ && curl -o latest -L https://securedownloads.cpanel.net/latest && sudo sh latest --skip-wptoolkit --skip-cloudlinux --force
```

![Cpanel Login](images/installation.png)
Expand Down

0 comments on commit 43c5016

Please sign in to comment.