# Shared Hosting

Concord CRM can be deployed on shared hosting environments — including those managed with **cPanel**, **Plesk**, or **DirectAdmin** — allowing you to host multiple tenants under a single shared hosting account.

Unlike the **cPanel Integration**, this setup does **not** provide API-based automation for tenant provisioning. Instead, it relies on **manual configuration** and a few critical hosting prerequisites to ensure that tenants can be created and accessed properly.

***

### ⚙️ Overview

When running Concord CRM in a shared hosting environment, you can still offer multi-tenancy functionality. However, due to **restricted permissions** and **lack of root access**, some automation features (such as domain and database provisioning) cannot be performed automatically.

Instead, you’ll configure your shared hosting environment manually once — and Concord CRM will handle tenant routing internally based on subdomains or custom domains.

***

### ⚠️ Limitations of Shared Hosting

Before enabling multi-tenancy in a shared hosting environment, carefully review the following limitations:

#### 🔒 1. No Root or API Access

Shared hosting plans do not provide **root** or **API** access required for automated resource creation.\
As a result:

* **Automatic subdomain/addon domain creation is not possible.**
* **Automatic database creation per tenant is not supported.**
* **Automatic DNS or SSL setup cannot be performed.**

All these tasks must be configured manually before tenants can be provisioned.

***

#### 🧩 2. Database Multitenancy Limitation

Without root or API-level database access, **Concord CRM cannot create or manage separate MySQL databases** for each tenant.

To use multi-tenancy on shared hosting:

* You must configure **a single shared database** with **table-based tenant separation**, or
* Use a **MySQL user with sufficient privileges** to manage databases manually in advance.

> ⚠️ **Recommendation:**\
> For true isolated database-per-tenant setups, a VPS or dedicated hosting environment with root access is strongly recommended.

***

#### 🌍 3. Wildcard Subdomain Requirement

To allow automatic subdomain-based tenant routing (e.g., `tenant1.yourcrm.com`, `tenant2.yourcrm.com`), you **must configure a wildcard subdomain** in your hosting DNS.

This ensures that all tenant subdomains resolve correctly to your main Concord CRM installation.

**Example DNS Record:**

```
Type: A
Host: *.yourcrm.com
Value: <Your Server IP>
TTL: 14400
```

> 💡 **Note:** Without a wildcard DNS entry, each tenant subdomain will need to be manually added to your hosting panel, which can become unmanageable over time.

***

#### 🔐 4. Manual SSL Configuration

SSL certificates (AutoSSL or Let’s Encrypt) must be configured manually for wildcard or individual subdomains.

Because most shared hosting environments do not issue wildcard SSL certificates automatically, you may need to:

* Purchase a **wildcard SSL certificate** (`*.yourcrm.com`), or
* Use **Let’s Encrypt** if supported by your provider, and reissue it for each new subdomain.

***

#### ⚙️ 5. Manual Database Setup

If your hosting provider supports multiple databases:

* Create a database manually for each tenant.
* Provide credentials for each in Concord CRM’s tenant configuration file or through the UI (if supported).

Otherwise, all tenants will share the same database instance, with Concord CRM managing tenant separation internally.

***

### 🔧 Configuration Steps

#### 1. Prepare Your Hosting Environment

1. Ensure PHP and MySQL versions meet Concord CRM’s requirements.
2. Configure your **Document Root** for the CRM installation (e.g., `/home/username/public_html/crm`).
3. Set up **wildcard subdomain** in DNS pointing to your CRM installation.
4. (Optional) Add a wildcard SSL certificate for secure subdomain routing.

***

#### 2. Concord CRM Settings

In **Concord CRM > SaaS > Settings**, configure the following:

| Setting                            | Description                                                                             |
| ---------------------------------- | --------------------------------------------------------------------------------------- |
| **Hosting Type**                   | Select “Shared Hosting.”                                                                |
| **Subdomain Mode**                 | Enable this if you are using wildcard DNS for tenants.                                  |
| **Database Connection**            | Configure a shared database connection or specify credentials for each tenant manually. |
| **MySQL Root Settings (Optional)** | Used only if your hosting supports MySQL user privileges for database management.       |

***

#### 3. Tenant Creation

When you create a new tenant under **Concord CRM > SaaS > Tenants**, the system will:

* Register the tenant in the shared database (or pre-created one).
* Route requests to `tenantname.yourcrm.com` using the wildcard DNS.

No hosting-level resource creation will occur automatically.

***

### 🧪 Testing Your Setup

1. Create a new tenant in **Concord CRM > SaaS > Tenants**.
2. Verify the tenant’s subdomain resolves correctly (e.g., `tenant1.yourcrm.com`).
3. Check that the tenant database or schema is accessible.
4. If using SSL, confirm the certificate is active for the wildcard domain.

If any step fails, ensure that:

* DNS has fully propagated (can take up to 24 hours).
* Wildcard DNS and SSL are correctly configured.
* Your hosting provider allows subdomain routing to your CRM directory.

***

### 🧠 Best Practices & Recommendations

| Task                            | Shared Hosting                   | Recommended Alternative        |
| ------------------------------- | -------------------------------- | ------------------------------ |
| Automated domain/database setup | ❌ Not supported                  | ✅ Use cPanel Integration       |
| Database per tenant             | ❌ Not supported (no root access) | ✅ Use VPS or Dedicated Hosting |
| Wildcard DNS                    | ✅ Required                       | ✅ Same                         |
| SSL management                  | 🔧 Manual                        | ✅ Automated via API            |
| API-level automation            | ❌ Not available                  | ✅ Full with cPanel Integration |

***

### ✅ Summary

| Feature                     | Supported on Shared Hosting | Notes                                |
| --------------------------- | --------------------------- | ------------------------------------ |
| Subdomain Routing           | ✅ (with Wildcard DNS)       | Must be configured manually          |
| Addon Domain Creation       | ❌                           | Not possible without API/root access |
| Automated Database Creation | ❌                           | Manual setup required                |
| SSL Certificates            | ⚙️ Manual                   | Wildcard SSL recommended             |
| API Access                  | ❌                           | Not available on shared hosting      |
| Multi-Database Isolation    | ⚠️ Limited                  | Table-based tenancy only             |

***

**In short:**\
Shared hosting can run Concord CRM successfully, but it requires **manual configuration** of DNS, SSL, and databases. For full automation — including tenant-specific subdomain and database creation — it is strongly recommended to use **cPanel Integration** or a **VPS/Dedicated Server** setup.
