Complete installation guide

Setup Tutorial

Install, configure and launch your crypto investment platform - on a live Virtualmin / Webmin server, or locally on XAMPP.

What you are installing

Client area
Portfolio dashboard with live market prices, 5 investment plans, twice-monthly withdrawals, notifications & announcements, KYC submission, referrals.
Admin console
Live pending monitors, analytics & charts, client manager with KYC review, manual credit/debit, announcements, CSV exports, plan & settings editor.
Engines
Daily interest cron (idempotent, auto-matures plans) plus live CoinGecko prices cached for 90 seconds.

Requirements

  • PHP 7.4 or newer (PHP 8.x recommended) with the pdo_mysql extension.
  • MySQL / MariaDB database server.
  • Either Virtualmin / Webmin on a Linux server, or XAMPP on your PC.
  • PHP must be able to make outbound HTTPS requests to api.coingecko.com for the live price widgets (CLI curl to api.coingecko.com or allow_url_fopen=On). If the API is unreachable the site shows safe fallback prices, so this is optional but recommended.
  • Only http:// or https:// access - the site will not load correctly from file://.
Option A

Deploying to Virtualmin / Webmin (live server)

1

Create a Virtual Server for your domain

  1. Log in to Virtualmin at https://YOUR-SERVER:10000 (Webmin login).
  2. Make sure your domain (e.g. invest.example.com) has a DNS A record pointing at your server's IP.
  3. Go to Virtualmin → Create Virtual Server and enter:
    • Domain name: your domain
    • Create an Administrator password for the server's FTP/SFTP user (Virtualmin makes one automatically).
    • Enable Apache website and MySQL database. Disable DNS, or enable it only if Virtualmin manages your DNS.
  4. Click Create Server. Virtualmin builds the website, database and an FTP/SFTP user in one step.
  5. From now on this server appears under Virtualmin → "Domain Name" and you manage everything from that screen.
2

Upload the project files

  1. Open the virtual server → File Manager (or connect with an SFTP client like FileZilla using the admin user and password from step A1).
  2. Go to the website's document root. Virtualmin stores it at either:
    ~/public_html/          (some setups)
    ~/domains/domain.com/public_html/   (others)
    You can see the exact path under the virtual server → Server Configuration → Website for domain ("Document root").
  3. Upload the contents of the crypto-invest folder directly into the document root so that index.php sits at the top (cleaner URLs):
    ~/domains/domain.com/public_html/index.php
    (Alternatively upload the crypto-invest folder itself; your URLs then carry a /crypto-invest prefix.)
  4. After uploading, run Virtualmin → "Re-check configuration" to auto-fix permissions and ownership.
  5. If permissions need a manual fix, ensure files are owned by the virtual server user (e.g. invest) and folders are 755 / files 644:
    chown -R invest:invest ~/domains/domain.com/public_html
    find ~/domains/domain.com/public_html -type d -exec chmod 755 {} \;
    find ~/domains/domain.com/public_html -type f -exec chmod 644 {} \;
3

Check PHP version & modules

  1. Open the virtual server → Server Configuration → PHP Options (Virtualmin may list this as "PHP" or "Configure PHP for this domain").
  2. Select a PHP version of 7.4 or newer (8.1/8.2 recommended). Modern Ubuntu/Debian Virtualmin templates install PHP 8.x by default.
  3. Confirm these PHP extensions are enabled: pdo, pdo_mysql, session, mysqli, openssl, json, mbstring. For live prices also enable curl (or allow_url_fopen).
  4. If your distro is missing them, run on the server (as root):
    apt install php-mysql php-mbstring php-curl php-xml
    systemctl restart apache2
Virtualmin's Default Settings → PHP Options applies your choices to every future virtual server. The per-domain screen shown above only affects this one.
4

Create the database & point config.php to it

  1. Open the virtual server → MySQL Databases.
  2. Click Create a new database (Virtualmin names it e.g. invest_db), and let Virtualmin generate a database user and password (e.g. user invest_user). Note them down.
  3. Edit config.php in the project and set the values Virtualmin gave you:
    <?php
    
    define('DB_HOST', 'localhost');
    define('DB_PORT', 3306);
    define('DB_NAME', 'invest_db');
    define('DB_USER', 'invest_user');
    define('DB_PASS', 'the_generated_password');
    
    date_default_timezone_set('UTC');
  4. Optional but tidy: you may rename the database to crypto_invest in Virtualmin so it matches the default, but it is not required.
  5. Re-upload the edited config.php if you edited it on your PC.
5

Run the installer & enable HTTPS

  1. In your browser open:
    https://domain.com/install.php    (or https://domain.com/crypto-invest/install.php if you kept the subfolder)
  2. The installer creates the database, all tables, the 5 default plans and the admin account, then shows the admin credentials. Save them.
  3. Enable free SSL: open the virtual server → SSL Certificate → Let's EncryptRequest a Let's Encrypt certificate (enable "Automatically renew"). Then force HTTPS under Server Configuration → Website.
  4. Visit https://domain.com/ and confirm the landing page renders.
Manual option: you can instead import setup.sql via MySQL Databases → Manage (phpMyAdmin). Running install.php is simpler.
If install.php reports a database connection error, double-check the values in config.php, that the database really exists under MySQL Databases, and that the DB user has all privileges on it. Hostname is almost always localhost.
6

Change the admin password

  1. Open https://domain.com/admin/ and sign in with the credentials shown by the installer (default admin / admin12345).
  2. Go to Settings → Administrator password and set a strong, unique password. Click Update admin password.
Do not skip this. Deploying with the default password is how panels get compromised.
7

Schedule the daily interest engine (cron)

The file cron/daily_interest.php must run once per day so clients earn interest automatically. It also sends the daily notifications and marks matured plans completed.

  1. Open the virtual server → Cron Jobs → Scheduled CommandsCreate a new scheduled command.
  2. Schedule: run daily, e.g. at 01:00 (crontab syntax 0 1 * * *).
  3. Command (adjust the path to your document root):
    php /home/USER/domains/domain.com/public_html/cron/daily_interest.php
    If PHP is not in PATH, use its full path (e.g. /usr/bin/php8.1 ...) - find it by running which php in a terminal.
Manual test: visit https://domain.com/cron/daily_interest.php in a browser to run it once immediately. The scheduler is what keeps it running every day.
The engine is idempotent - running it twice in one day never double-credits. Interest starts the day after a plan is activated and stops at maturity.
8

Test the whole flow

Client side
  1. Register: register.php - create a client account.
  2. KYC & profile: complete profile.php (country, ID details, wallet).
  3. Deposit: submit a deposit request (deposit.php shows live BTC/ETH/USDT/TRX prices).
  4. Invest: activate a plan from the credited balance.
  5. Interest: run the cron → daily interest appears in the balance and in the notification bell.
  6. Withdraw: during a window (days 13–17 or 28–31, or when forced open in Settings), request a payout (funds held).
Admin side
  1. Console → Deposits → Approve → balance credited instantly.
  2. Console → Withdrawals → Approve (payout sent) or Reject (funds auto-refunded).
  3. KYC review: admin/users.php → open a client → Approve/Reject their verification.
  4. Analytics: the dashboard shows interest lines, allocation bars, AUM-by-plan, recent signups and the audit log.
  5. Broadcast: admin/announcements.php publishes a notice to every client's dashboard and bell.
  6. Exports: admin/export.php downloads clients/transactions/deposits/withdrawals as CSV.

Option B

XAMPP on Windows (local development)

1

Install XAMPP

  1. Download and install XAMPP from apachefriends.org.
  2. Open the XAMPP Control Panel.
  3. Click Start next to Apache and Start next to MySQL. Both buttons should turn green. Leave them running.
2

Copy the project into htdocs

  1. Open File Explorer and go to your XAMPP install folder (default C:\xampp).
  2. Open the htdocs folder.
  3. Copy the whole crypto-invest project folder into htdocs, so the result is:
    C:\xampp\htdocs\crypto-invest\index.php
3

Run the installer

  1. Open your browser and go to:
    http://localhost/crypto-invest/install.php
  2. The installer automatically creates the crypto_invest database, all tables, the 5 default plans and the admin account.
  3. On success you will see the admin credentials. Save them.
Manual option: you can also import setup.sql via phpMyAdmin (http://localhost/phpmyadmin → Import). Running install.php is simpler.
4

Log in & change the admin password

  1. Open http://localhost/crypto-invest/admin/index.php
  2. Sign in with the admin credentials shown by the installer (default admin / admin12345).
  3. Go to Settings → Administrator password and set a strong password, then Update admin password.
5

Configure the site

  1. In the admin console go to Settings.
  2. Replace the example crypto wallet addresses (e.g. bc1qexample...) with your real deposit wallets.
  3. Set your minimum deposit / minimum withdrawal amounts.
  4. Review the withdrawal windows. Defaults: days 13–17 and 28–31 of each month - clients can only request payouts during these two windows.
  5. Review the referral credit percent (default 5%).
  6. Click Save settings.
6

Set up the daily interest engine

The file cron/daily_interest.php must run once per day. It credits each active plan's daily interest, then marks matured plans completed.

Windows Task Scheduler
  1. Open Task SchedulerCreate Basic Task.
  2. Name it Crypto Interest. Trigger: Daily, e.g. 01:00 AM.
  3. Action: Start a program.
  4. Program/script: C:\xampp\php\php.exe
  5. Add arguments: C:\xampp\htdocs\crypto-invest\cron\daily_interest.php
  6. Finish.
Manual test: visit http://localhost/crypto-invest/cron/daily_interest.php in a browser to run it once immediately.
The engine is idempotent - running it twice in one day never double-credits. Interest starts the day after a plan is activated and stops at maturity.
7

Test the whole flow

Client side
  1. Register: register.php - create a client account.
  2. Deposit: submit a deposit request.
  3. Invest: activate a plan from the credited balance.
  4. Interest: run the cron → daily interest appears in the balance.
  5. Withdraw: during a window, request a payout (funds held).
Admin side
  1. Admin console → Deposits → Approve → balance credited instantly.
  2. Admin console → Withdrawals → Approve (payout sent) or Reject (funds auto-refunded).
  3. Live monitor: the admin dashboard refreshes pending requests with toast notifications, and shows analytics, ops status and the audit log.

Important URLs

PageURL (Virtualmin example)
Public websitehttps://domain.com/
Installerhttps://domain.com/install.php
Client loginhttps://domain.com/login.php
Client notificationshttps://domain.com/notifications.php
Referral / affiliatehttps://domain.com/referral.php
Admin loginhttps://domain.com/admin/
Admin announcementshttps://domain.com/admin/announcements.php
Admin CSV exportshttps://domain.com/admin/export.php
Interest enginecron/daily_interest.php
Virtualmin panelhttps://YOUR-SERVER:10000
phpMyAdmin (Virtualmin)virtual server → MySQL Databases → Manage

Default admin credentials

Admin URL
https://domain.com/admin/
Username
admin
Email
admin@example.com
Password
admin12345
Change this password immediately after first login. Go to Settings → Administrator password. Also change the FTP/SFTP password from Virtualmin → Change Password.

Live prices

Public pages, the client dashboard and the admin console show live crypto prices from the CoinGecko API. Prices are fetched at most every 90 seconds (cached in the price_cache table), and the browser auto-refreshes them every 30 seconds.

  • The API is called server-side from includes/prices.php via cURL (or file_get_contents if enabled).
  • If the API is unreachable (blocked outbound traffic, firewall, rate limit) the site shows cached/default prices, so the pages never break.
  • Confirm outbound HTTPS is allowed in your Virtualmin firewall if prices stay on the default values.

File structure

crypto-invest/
├─ config.php                 DB credentials (edit on Virtualmin!)
├─ install.php               One-click setup (DB + seed data)
├─ setup.sql                 Manual SQL schema + seed data
├─ setup.html                This tutorial
├─ index.php                 Landing page / 5 plans / live ticker
├─ register.php / login.php / logout.php
├─ dashboard.php             Client portfolio dashboard + live prices
├─ invest.php                Activate a plan from balance
├─ deposit.php               Deposit request + live coin prices
├─ withdraw.php              Twice-monthly payout request
├─ history.php               Transaction history
├─ notifications.php         Client notification inbox
├─ referral.php              Referral link + stats
├─ profile.php               Profile / KYC / wallet / password
├─ prices_json.php           JSON endpoint used by the price widgets
├─ includes/                 Headers, db, helpers (functions, prices)
├─ admin/                    Console (login, dashboard + analytics,
│                                users + KYC review, deposits,
│                                withdrawals, investments, packages,
│                                announcements, exports, settings)
├─ cron/daily_interest.php   Daily interest engine (cron job)
└─ assets/                   CSS + JS

Compliance before going live

High-yield "daily return" products that are not backed by real, lawful business activities can be illegal in many jurisdictions and are frequently used in fraudulent schemes. Before launching publicly you should:

  • Run the business model past qualified legal/financial advice for your jurisdiction.
  • Implement real, lawful business/revenue operations that can actually fund the promised returns.
  • Follow all securities, anti-fraud, KYC/AML, tax and advertising regulations.
  • Never represent guaranteed returns you cannot lawfully provide.
The entire brand identity - company name, logo, email domain, legal pages - is demo/placeholder content and must be replaced before any real use. This is a working template (demo / fintech prototype / orderly term-deposit model). The developer accepts no liability for how it is used.