Arama Yap Mesaj Submit
Request a Callback
+90
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro

Contact Us

Location Halkali merkez neighborhood fatih st ozgur apt no 46 , Kucukcekmece , Istanbul , 34303 , TR
Bulk domain automation

Add hundreds of domains to WHM and cPanel in a controlled bulk operation

This guide compares creating a separate cPanel account for every domain with using addon domains under one account and separate document roots. The ready Bash script includes domain validation, unique user generation, CSV results and retryable error logging.

WHM API 1 cPanel API 2 SSH Bash DNS AutoSSL
root@eka-server
whmapi1 createacct domain=ornek.com username=d123456789ab plan=domainpaket
/usr/local/cpanel/bin/cpapi2 --user=sitehesabi AddonDomain addaddondomain newdomain=ornek.com
/scripts/rebuildhttpdconf && /scripts/restartsrv_httpd
100+Scalable for domains
2Account and addon modes
CSVResults and credential log
SSHAutomation as root
01
Architecture decision

Choose the correct hosting model before adding hundreds of domains

Bulk automation should not accelerate a wrong architecture. Decide customer isolation, resource limits, application roots, mail and DNS ownership first.

01

Separate cPanel account

Suitable for customers, isolated resource limits and separate FTP/email management. It may affect licensed account count.

02

Addon domains under one account

Creates less administrative overhead when all domains belong to you and separate directories are sufficient.

03

Alias / same website

If every domain must show the same content, use redirects or aliases instead of duplicating sites.

04

DNS management model

Nameserver changes, A-record routing and Cloudflare bulk actions must be planned separately from panel domain creation.

02
Prerequisites

Requirements to complete before the bulk operation

Root SSH access and an up-to-date cPanel/WHM installation01
A UTF-8 domainler.txt file with one domain per line02
A pre-created hosting package for separate-account mode03
An account limit that accommodates the total number of domains in addon mode04
Access to DNS or nameserver settings for the domains05
A cPanel configuration and DNS backup before the operation06
03
Implementation order

A controlled and recoverable bulk-add workflow

01

Clean the domain list

Remove https://, www, paths, blank rows and duplicates. Convert IDN domains to Punycode.

sort -u domainler.txt | sed '/^[[:space:]]*$/d' > domainler-temiz.txt
02

Choose the mode

MOD=hesap creates a cPanel account per domain; MOD=addon creates separate folders under the target user.

MOD="addon"
03

Run a two-domain pre-test

Validate the package, account limits, DNS role and API output with a small sample.

head -n 2 /root/domainler.txt > /root/domainler-test.txt
04

Run the script as root

Set file permissions to 700 and keep result files readable only by root.

chmod 700 /root/cpanel-toplu-domain.sh
/root/cpanel-toplu-domain.sh
05

Review results and error logs

Extract failed domains into a separate list and rerun only those.

column -s, -t < /root/cpanel-domain-sonuclari.csv
cat /root/cpanel-domain-errorlari.log
06

Process DNS and AutoSSL in stages

Verify DNS resolution first, then run AutoSSL in small batches.

dig +short ornek.com A
/usr/local/cpanel/bin/autossl_check --user=sitehesabi
04
SSH, CLI and API

Copy-ready commands and complete automation script

01

Complete bulk-add script

Runs in account or addon mode; writes results to CSV and errors to a separate log.

#!/usr/bin/env bash
set -Eeuo pipefail

MOD="addon"
DOMAIN_DOSYASI="/root/domainler.txt"
CPANEL_KULLANICI="sitehesabi"
PLAN="domainpaket"
ILETISIM="[email protected]"
SONUC="/root/cpanel-domain-sonuclari.csv"
HATA="/root/cpanel-domain-errorlari.log"

[[ "$EUID" -eq 0 ]] || { echo "root gerekli"; exit 1; }
[[ -f "$DOMAIN_DOSYASI" ]] || { echo "domain listesi bulunamadi"; exit 1; }

printf '"domain","mod","durum","kullanici","sifre"\n' > "$SONUC"
: > "$HATA"
chmod 600 "$SONUC" "$HATA"

while IFS= read -r SATIR || [[ -n "$SATIR" ]]; do
    DOMAIN="$(printf '%s' "$SATIR" | tr -d '\r' | tr '[:upper:]' '[:lower:]' | sed -E 's#^[[:space:]]+##;s#[[:space:]]+$##;s#^https?://##;s#^www\.##;s#/.*$##')"
    [[ -z "$DOMAIN" ]] && continue
    [[ "$DOMAIN" == \#* ]] && continue

    if [[ ! "$DOMAIN" =~ ^[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$ ]]; then
        printf '"%s","%s","gecersiz","",""\n' "$DOMAIN" "$MOD" >> "$SONUC"
        continue
    fi

    HASH="$(printf '%s' "$DOMAIN" | sha256sum | cut -c1-12)"
    KULLANICI="d${HASH}"
    ALTALAN="eka${HASH}"
    SIFRE="Eka!$(openssl rand -hex 12)A9"

    if [[ "$MOD" == "hesap" ]]; then
        CIKTI="$(whmapi1 --output=json createacct domain="$DOMAIN" username="$KULLANICI" password="$SIFRE" plan="$PLAN" contactemail="$ILETISIM" 2>&1 || true)"
        if grep -Eq '"result"[[:space:]]*:[[:space:]]*1' <<< "$CIKTI"; then
            printf '"%s","hesap","basarili","%s","%s"\n' "$DOMAIN" "$KULLANICI" "$SIFRE" >> "$SONUC"
        else
            printf '%s | %s\n' "$DOMAIN" "$CIKTI" >> "$HATA"
            printf '"%s","hesap","errorli","%s",""\n' "$DOMAIN" "$KULLANICI" >> "$SONUC"
        fi
    else
        KLASOR="domains/${DOMAIN}/public_html"
        CIKTI="$(/usr/local/cpanel/bin/cpapi2 --user="$CPANEL_KULLANICI" --output=jsonpretty AddonDomain addaddondomain dir="$KLASOR" newdomain="$DOMAIN" subdomain="$ALTALAN" 2>&1 || true)"
        if grep -Eq '"result"[[:space:]]*:[[:space:]]*1' <<< "$CIKTI"; then
            printf '"%s","addon","basarili","%s",""\n' "$DOMAIN" "$CPANEL_KULLANICI" >> "$SONUC"
        else
            printf '%s | %s\n' "$DOMAIN" "$CIKTI" >> "$HATA"
            printf '"%s","addon","errorli","%s",""\n' "$DOMAIN" "$CPANEL_KULLANICI" >> "$SONUC"
        fi
    fi
done < "$DOMAIN_DOSYASI"

echo "Tamamlandi: $SONUC"
echo "Errorlar: $HATA"
02

Quick system check

Check API tools, version and account limits.

whmapi1 version
/usr/local/cpanel/bin/cpapi2 --help | head
whmapi1 acctcounts
03

Verify created domains

Display the domain inventory of the target cPanel account with UAPI.

uapi --user=sitehesabi DomainInfo list_domains
04

Rebuild web server configuration

When necessary, rebuild Apache configuration and restart it in a controlled way.

/scripts/rebuildhttpdconf
/scripts/restartsrv_httpd
05
Operating system and stack

What changes by distribution and web server

AlmaLinux / Rocky / CloudLinux

This is the primary production family supported by cPanel. On CloudLinux, use the full cpapi2 path and check LVE/domain limits separately.

  • cat /etc/os-release
  • cloudlinux-summary get-licenses 2>/dev/null || true
  • lveinfo --period=1h 2>/dev/null | head

Ubuntu

Verify operating-system support for your installed cPanel version; service names and package management can differ by distribution.

  • cat /etc/os-release
  • whmapi1 version
  • systemctl status cpanel --no-pager

DNSOnly / separate DNS cluster

When using a DNS cluster, test zone synchronization and cluster roles before the bulk operation.

  • whmapi1 listdnszones | head
  • /scripts/dnscluster syncall
  • whmapi1 get_nameserver_config
06
Troubleshooting

Common errors during bulk domain creation

5 entries
Error message

Account Creation Status: failed

Can be caused by username collision, package name, account limits or an existing domain on the server.

Error message

This domain already exists

The domain may exist under another account, as a DNS zone or in stale userdata.

Error message

API failure: Permission denied

The command may not be running as root, the API feature may be disabled or the account lacks permission.

Error message

Sorry, the domain is already pointed

Remote domain checks or DNS resolution may show that the domain points to another IP.

Error message

AutoSSL DCV failed

A/AAAA records, CAA, proxying or the HTTP validation path may be incorrect.

No matching error was found.

Security and operational risks

Do not go to production before these checks

  • Run the first execution with 2 test domains; do not push the complete domain list directly to production.
  • Prepare the domain list as plain domain names without HTTPS, www or paths.
  • Back up panel configuration, DNS zones and web server files before the operation.
  • Never store API keys, root passwords or generated user passwords in the web root.
  • Requesting bulk SSL before DNS propagation completes can cause rate limits and failed validation.
Verification checklist

Criteria for a successful operation

  • Domains appear in the panel or web server listing.
  • Each domain resolves to the correct document root directory.
  • The HTTP request returns the expected status code.
  • DNS A/AAAA records point to the correct server IP address.
  • Failed records are written to a separate log and can be retried.
  • SSL is enabled only for domains that pass DNS validation.
07
Frequently asked questions

WHM / cPanel bulk domain management answers

Is it appropriate to add hundreds of domains to one cPanel account?

It can work when all domains have the same owner and application isolation is unnecessary. Separate accounts are better for different customers, resource limits or security boundaries.

Why is cpapi2 used for addon domains?

cPanel marks API 2 as deprecated but explicitly states that no equivalent UAPI function exists for AddonDomain::addaddondomain. Test it on your installed version.

Can SSL be issued automatically for every domain?

AutoSSL can be used after DNS points to the server. Do not start validation for hundreds of domains at once before checking propagation.

How are domains with Turkish characters added?

Use the Punycode form in panel and API operations; the Unicode display form can be stored separately.

Can the process be rerun after interruption?

Yes. Remove successful entries from the source list and rerun only failed domains. Adding an existing-domain check also makes the script idempotent.

Can first place on Google be guaranteed?

No. Technical SEO, original content, valid structured data and internal links support visibility, but rankings cannot be guaranteed.

08
Topic cluster

Other bulk domain addition guides

09
Primary sources

Official panel, web server and Google documentation

EKA SOFTWARE AND INFORMATION SYSTEMS

Plan your large-scale domain migration without data loss or downtime

We implement panel selection, DNS, SSL, web server, security, backup and verification according to your actual server architecture.

Top