Create and manage website using CyberPanel and CLI

In this chapter, you will learn

  1. How to Create, Delete, Modify Domain/Website using CyberPanel and Command Line Interface (CLI)

It is very easy to add domain or create website using CyberPanel. You can create, modify, and delete website easily with CyberPanel web interface.

Create and Manage Website using CyberPanel

Create a website:

To create a new website, follow the instructions:

Step 1: Login to CyberPanel.
Step 2: Go to Websites → Create Website.
Step 3: Fill the following details:
  1. Package: Select the appropriate package.
  2. Owner: Select the appropriate owner.
  3. Domain Name: Insert domain name without www.
  4. Email: Provide your email address.
  5. Select PHP: Select your desired PHP version.
  6. Additional Features:
    1. SSL: Enable this option to install SSL on your website.
    2. DKIM support: It enhances the email security by verifying the email authenticity and digital signature.
    3. open_basedir Protection: It enhances the security by disallowing users to access files outside from its home directory.
    4. Create Mail Domain: It creates a mail domain to send or receive emails.
  7. Click on the Create Website button to create a new website. It will take just a few seconds/minutes and that's all.

Modify Website

Modify website will allow you to modify Package, Owner, Email, and PHP versions.

Step 1: Go to Websites → Modify Website.
Step 2: Modify details according to your need.
Step 3: Click on the Modify Website button.

Suspend/Unsuspend Website

Suspend/Unsuspend Website option allows you to temporarily suspend or unsuspend websites.

Go to Website → Suspend/Unsuspend Websites → Select Website → Select Suspend/Unsuspend option and then click on Save button.

Delete Website

If you want to remove a website, use this option. Go to Websites → Delete Website. Select website to delete and click on the Delete Website button.

Creating Subdomain

A subdomain is an extension of the main website. For example, if we want to create a separate discussion portal for easycodelab.com with a different design, we can create a subdomain such as forum.easycodelab.com.

The benefit of creating a subdomain is that you don't need to register a new domain name. Additionally, you don't need to configure DNS records because the subdomain inherits configurations from the main website.

Step 1: Go to Websites → Create Sub/Addon Domains
Step 2: Select Domain Type → Sub Domain from the dropdown menu.
Step 3: Select main website for which you want to create a subdomain.
Step 4: Fill domain name such as forum.easycodelab.com and fill the other options such as PHP version, Path, Additional features, etc.
Step 5: Click on the Create Domain to create a subdomain.

Creating and Managing Website using CyberPanel CLI

Create Website:

sudo cyberpanel createWebsite --package default --owner admin --domainName easycodelab.com --email [email protected] --php 8.1
{"success": 1, "errorMessage": "None"}

List Website:

sudo cyberpanel listWebsitesPretty
+----+-----------------+---------------+---------+-------+--------+-----------------------------+ | ID | Domain | IP Address | Package | Owner | State | Email | +----+-----------------+---------------+---------+-------+--------+-----------------------------+ | 2 | mysite.com | 152.59.145.73 | Default | admin | Active | [email protected] | | 3 | easycodelab.com | 152.59.145.73 | Default | admin | Active | [email protected] | +----+-----------------+---------------+---------+-------+--------+-----------------------------+

Delete Website:

sudo cyberpanel deleteWebsite --domainName easycodelab.com
{"success": 1, "errorMessage": "None"}

Summary

Creating and Managing website using CyberPanel is very easy. You can Create, modify, delete, and suspend/unsuspend website using its control panel.