Category: Advanced Features" Level: Advanced" Reading time: 30 minutes" Updated: 2026-02-07"

Self-Hosted Data Server

Quick Summary: Host participant data on your own infrastructure for GDPR compliance and data sovereignty while using PEBL Hub's study management platform.

Overview

The Self-Hosted Data Server allows you to collect participant data on your own server while still using PEBL Hub's platform for study configuration, test delivery, and participant management.

Key Benefit: Data never leaves your infrastructure - perfect for EU institutions, hospitals, and organizations with strict data governance requirements.

Architecture: Simple file-based storage (no database required) - files are organized in directories by study and participant.

---

Who Needs This?

✅ You Should Use Self-Hosted Data Server If:

  • EU-based researchers needing GDPR compliance
  • Healthcare institutions with patient data restrictions
  • Organizations requiring data to stay within specific geographic regions
  • Institutions with strict data sovereignty policies
  • Research teams that cannot use US-hosted cloud services

⚠️ You May NOT Need This If:

  • You're comfortable with standard cloud data storage
  • You don't have geographic data restrictions
  • You want the simplest setup possible
  • You're using PEBL Hub's default data storage

---

Account Requirements

Tier Required: Research+ with Hosted Server

The self-hosted data server feature is available only to users with the Research+ with Hosted Server tier, which includes:

  • ✅ All Research+ benefits (unlimited studies, participants, tests)
  • ✅ Self-hosted data server capability
  • ✅ Priority support for server setup

Not on this tier? Upgrade to Research+ with Hosted Server

---

How It Works

Traditional Setup (Default)

Participant → PEBL Hub Platform → PEBL Hub Database

Your Data Export

Self-Hosted Setup

Participant → PEBL Hub Platform → YOUR Server
(study interface) (file storage)

uploads/
├── studyabc/
│ ├── P001/
│ │ └── data.csv
│ └── P002/
└── study
def/

Important: PEBL Hub never sees or stores your participant data. It goes directly from the participant's browser to your server via a secure CORS-enabled connection.

Data Storage: All data is stored as files in an organized directory structure - no database required!

---

Getting Started

Step 1: Download the Server Package

  1. Log in to PEBL Hub
  2. Visit the Downloads page
  3. Download the latest PEBL Hosted Data Server package
  • File: pebl-hosted-data-server-v{VERSION}.zip
    • Size: ~40 KB

Note: The downloads page shows available versions - choose the most recent.

Step 2: Server Requirements

Your server must have:

Required:

  • ✅ PHP 5.5 or higher (PHP 7.4+ recommended for security)
  • ✅ HTTPS (SSL certificate) - strongly recommended
  • ✅ Web server (Apache with .htaccess, or Nginx)
  • ✅ Writable directory permissions

Recommended:

  • 📊 1 GB+ disk space (depending on study size)
  • 🌐 Stable internet connection
  • 🔒 Firewall configured to allow HTTP/HTTPS

NOT Required:

  • ❌ Database (MySQL, PostgreSQL, SQLite, etc.)
  • ❌ Special PHP extensions (beyond standard installation)

Step 3: Upload and Install

Option A: cPanel (Easiest)

  1. Upload ZIP file:
  • Go to cPanel → File Manager
    • Navigate to public_html or desired directory
    • Upload pebl-hosted-data-server-v*.zip
    • Extract the ZIP file
  1. Run installer:
  • Visit: https://yourserver.com/pebl-data/install.php
    • Follow the 4-step installation wizard
  1. Delete installer:
  • After setup completes, delete install.php for security

Option B: FTP/SFTP

  1. Upload files - Extract locally then upload via SFTP:

# Extract locally unzip pebl-hosted-data-server-v.zip

# Upload via SFTP sftp user@yourserver.com put -r pebl-data-server /var/www/html/pebl-data

  1. Set permissions:

chmod 755 /var/www/html/pebl-data chmod 775 /var/www/html/pebl-data/uploads chmod 775 /var/www/html/pebl-data/data

  1. Run installer:
  • Visit: https://yourserver.com/pebl-data/install.php

Option C: SSH/Command Line

  1. Upload and extract:

cd /var/www/html wget https://yourserver.com/path/to/pebl-hosted-data-server-v.zip unzip pebl-hosted-data-server-v.zip mv pebl-data-server pebl-data cd pebl-data

  1. Set permissions:

chmod 755 . chmod 775 uploads data

  1. Run installer:
  • Visit: https://yourserver.com/pebl-data/install.php

Step 4: Installation Wizard

The installer has 4 steps:

Step 1: Requirements Check

  • ✅ PHP version (5.5+)
  • ✅ Directory permissions
  • ✅ Write access
  • ⚠️ HTTPS recommendation

Step 2: Configuration

  • Admin Username: Username for admin panel access
  • Admin Password: Choose a strong password (12+ characters)
  • Main Server URL: https://peblhub.online (for CORS)
  • Upload Limits: Max file size (default 10MB)

Step 3: Installation

  • Creates config.php with your settings
  • Creates uploads/ directory for data storage
  • Creates data/ directory for token management
  • Sets up admin authentication

Step 4: Complete

  • ✅ Server URL: https://yourserver.com/pebl-data
  • ✅ Admin Panel: https://yourserver.com/pebl-data/admin/
  • ⚠️ DELETE install.php for security

Save these URLs! You'll need them to configure studies.

---

Configuring Studies

Step 1: Register Your Server (Optional)

  1. Go to PEBL Hub → Hosted Servers
  2. Click Add Server
  3. Enter:
  • Server Name: e.g., "EU Hospital Server"
    • Server URL: https://yourserver.com/pebl-data
4. Click Test Connection
  1. Click Save

Step 2: Enable Hosted Storage for a Study

  1. Go to Studies → Select your study → Settings
  2. Find Data Storage section
  3. Check ☑ Use Self-Hosted Data Server
  4. Enter:
  • Server URL: https://yourserver.com/pebl-data
    • Study Token: Generate a unique token for this study
5. Click Test Connection to verify
  1. Click Save Study Settings

Step 3: Approve the Study Token

  1. Log into your hosted server admin panel: https://yourserver.com/pebl-data/admin/
  2. Navigate to Tokens section
  3. Add your study token to the approved list
  4. Save changes

Important: Only studies with approved tokens can upload data to your server.

Step 4: Test the Setup

  1. Open your study URL
  2. Complete a test run
  3. Check your hosted server admin panel
  4. Verify data appears in the uploads section

---

Accessing Your Data

Admin Panel

URL: https://yourserver.com/pebl-data/admin/

Features:

  • 📊 View uploaded files by study and participant
  • 🔑 Manage approved study tokens
  • 📁 Browse directory structure
  • 📈 View upload statistics

Direct File Access

Via FTP/SFTP

Connect to your server and navigate to:

/var/www/html/pebl-data/uploads/

Directory structure:

uploads/
├── studyabc123/
│ ├── P001/
│ │ ├── test1
data.csv
│ │ └── test2data.json
│ └── P002/
│ └── test1
data.csv
└── studydef456/
└── P001/
└── questionnaire.csv

Via cPanel File Manager

Navigate to: public_html/pebl-data/uploads/

You can:

  • Browse files
  • Download individual files
  • Compress and download entire directories
  • View file contents

Via SSH

cd /var/www/html/pebl-data/uploads/ ls -R # List all files recursively

# Find all CSV files find . -name ".csv"

# View a specific file cat studyabc123/P001/data.csv

Downloading All Data

Create Backup Archive

cd /var/www/html/pebl-data tar -czf data-backup-$(date +%Y%m%d).tar.gz uploads/

This creates a compressed archive of all your data files.

Via cPanel

  1. Navigate to uploads/ directory
  2. Right-click → Compress
  3. Choose tar.gz format
  4. Download the archive

---

Security Best Practices

1. Use HTTPS

Critical: Always use HTTPS for your hosted server.

  • ✅ Prevents data interception
  • ✅ Required for CORS to work properly
  • ✅ Meets GDPR encryption requirements

Get free SSL: Use Let's Encrypt or your hosting provider's SSL

2. Strong Admin Password

  • Use 16+ characters
  • Include uppercase, lowercase, numbers, symbols
  • Don't reuse passwords from other services
  • Store in a password manager

Generate secure password:

php generatepassword.php YourNewPassword123!

3. Token-Based Study Authentication

Each study should have a unique token:

  • Generate random tokens (20+ characters)
  • Only approve tokens for legitimate studies
  • Revoke tokens when studies complete
  • Monitor token usage via admin panel

4. Regular Backups

Backup the uploads directory regularly:

# Manual backup tar -czf backups/pebl-data-$(date +%Y%m%d).tar.gz uploads/

# Automated backup (cron) 0 2 tar -czf /backups/pebl-data-$(date +\%Y\%m\%d).tar.gz /var/www/html/pebl-data/uploads/

5. File Permissions

Recommended permissions:

chmod 755 /var/www/html/pebl-data # Directory readable chmod 775 /var/www/html/pebl-data/uploads # Uploads writable chmod 775 /var/www/html/pebl-data/data # Data writable chmod 644 /var/www/html/pebl-data/.php # PHP files readable chmod 600 /var/www/html/pebl-data/config.php # Config private

6. Monitor Server Health

The package includes a health check endpoint:

curl https://yourserver.com/pebl-data/health.php

Expected response:

{ "status": "ok", "version": "1.0", "phpversion": "7.4.33", "uploaddirwritable": true }

7. Delete install.php

After installation, delete install.php:

rm /var/www/html/pebl-data/install.php

Or via cPanel: Navigate to the file and delete it.

---

Troubleshooting

Problem: "CORS Error" in Browser Console

Symptoms: Data not uploading, browser shows CORS-related errors

Solutions:

  1. Check HTTPS: Both PEBL Hub and your server must use HTTPS
  2. Verify Main Server URL in config.php matches exactly:

define('MAINSERVERURL', 'https://peblhub.online');

  1. Check CORS headers in upload.php - should include proper Access-Control-Allow-Origin headers

Problem: "Study token not approved"

Symptoms: 403 error when trying to upload data

Solutions:

  1. Log into admin panel: https://yourserver.com/pebl-data/admin/
  2. Navigate to Tokens section
  3. Add your study token to the approved list
  4. Verify token matches exactly in study settings

Problem: "Failed to create upload directories"

Symptoms: 500 error during upload, directory creation fails

Solutions:

  1. Check permissions:

chmod 775 uploads/ chown www-data:www-data uploads/

  1. Verify uploads directory exists:

ls -la uploads/

  1. Check disk space:

df -h

  1. Check parent directory permissions - ensure web server can create subdirectories

Problem: "Cannot Access Admin Panel"

Symptoms: 404 or 403 error when accessing admin panel

Solutions:

  1. Check URL: Must end with /admin/ (trailing slash)
  2. Verify files exist: admin/index.php should be present
  3. Check .htaccess: Ensure modrewrite is enabled (Apache)
  4. Try direct access: admin/index.php explicitly

Problem: "Authentication Failed"

Symptoms: Cannot log in to admin panel

Solutions:

  1. Reset password via SSH:

cd /var/www/html/pebl-data php generatepassword.php newpassword # Copy the hash

  1. Update config.php:

define('ADMINPASSWORDHASH', 'paste-hash-here');

  1. Verify username matches what you're entering

Problem: "Data Not Appearing in Admin Panel"

Symptoms: Study runs but no data shows up

Solutions:

  1. Check study configuration: Verify server URL in study settings
  2. Test connection: Use "Test Connection" button in study settings
  3. Verify token approved: Check admin panel → Tokens
  4. Check uploads directory: Via FTP/SSH, verify files are being created
  5. Review PHP error logs: Check for upload failures

Problem: "File Upload Size Exceeded"

Symptoms: Large files fail to upload

Solutions:

  1. Edit config.php:

define('MAXFILESIZE', 52428800); // 50MB

  1. Check PHP limits in php.ini:

uploadmaxfilesize = 50M postmaxsize = 50M

  1. Restart web server after changes

Problem: "Permission Denied" Errors

Symptoms: Cannot write files, permission errors in logs

Solutions:

  1. Check ownership:

chown -R www-data:www-data /var/www/html/pebl-data/uploads

  1. Check SELinux (if on CentOS/RHEL):

chcon -R -t httpdsysrwcontentt uploads/

---

Frequently Asked Questions

Can I use this with existing studies?

Yes! Enable hosted server in study settings at any time. Future uploads will go to your server. Existing data remains on PEBL Hub unless you manually migrate it.

What happens if my server goes down?

Participants will see an error message during data upload. Consider setting up monitoring and redundancy for production use.

Can I use multiple hosted servers?

Currently, you can configure one server URL per study. Contact support for multi-server setups.

Is the hosted server package open source?

The package is proprietary but designed for transparency. The PHP code is readable and can be audited for security compliance.

Can I customize the file storage structure?

Yes! Edit upload.php to modify the directory structure. Default is uploads/study_token/participant_id/filename.

How much data can the server handle?

File-based storage capacity:

  • Typical usage: 100-10,000 files work perfectly
  • Heavy usage: 10,000-100,000 files - ensure adequate disk space
  • Very heavy: Consider organizing data or archiving old studies

Monitor disk usage regularly:

df -h /var/www/html/pebl-data/uploads

Does this work with custom tests?

Yes! Hosted servers work with both standard battery tests and custom uploaded tests. Any PEBL experiment can upload to your hosted server.

Can collaborators access the hosted server?

No. Only you (the server owner) have admin panel access. Collaborators can still manage studies on PEBL Hub, but data access is controlled by your server.

What file formats are supported?

Default allowed extensions: txt, csv, tsv, dat, log, json

Modify in config.php:

define('ALLOWEDEXTENSIONS', ['txt', 'csv', 'tsv', 'dat', 'log', 'json', 'xml']);

---

Advanced Configuration

Custom Upload Directory

Edit config.php:

define('UPLOADDIR', DIR . '/my-custom-data-dir/');

Study Token Validation

For additional security, require token validation:

  1. In config.php:

define('REQUIRESTUDYTOKEN', true);

  1. In PEBL Hub study settings:
  • Set unique Study Token for each study
  1. In admin panel:
  • Approve tokens for legitimate studies only

Logging Configuration

Enable detailed logging in config.php:

define('DEBUGMODE', true);

View PHP error logs (location varies by server):

# Common locations /var/log/apache2/error.log /var/log/nginx/error.log tail -f /var/log/apache2/error.log

IP Restrictions

Add IP restrictions to .htaccess:

Require ip 192.168.1.0/24 # Or specific IPs: # Require ip 1.2.3.4 5.6.7.8

Nginx Configuration

If using Nginx instead of Apache, add to server block:

location ~ /(config\.php|.*\.md|data/)$ { deny all; }

location /pebl-data/uploads/ { location ~ \.php$ { deny all; } }

---

Compliance Documentation

GDPR Compliance

Using a self-hosted data server helps achieve GDPR compliance:

Data Minimization: Only collect necessary data ✅ Storage Limitation: You control retention periods ✅ Confidentiality: Data stays on your infrastructure ✅ Integrity: HTTPS encryption prevents tampering ✅ Availability: You control backups and redundancy

Documentation for audits:

  • Server location: Document physical server location
  • Encryption: HTTPS in transit, encrypted backups at rest
  • Access control: Admin password authentication + token validation
  • Data retention: Configure automatic deletion/archiving as needed

Data Processing Agreement

If required, contact PEBL Hub support for a Data Processing Agreement (DPA) template covering:

  • Roles and responsibilities
  • Data controller vs. processor definitions
  • Security obligations
  • Breach notification procedures

---

Support and Resources

Documentation

Getting Help

For installation issues:

  • Check this troubleshooting guide first
  • Review server requirements section
  • Check PHP error logs for specific errors

For technical support:

  • Email: support@peblhub.online
  • Include: Server URL, PHP version, error messages
  • Attach: Relevant log files (sanitized of sensitive data)

For billing/tier questions:

  • Contact: billing@peblhub.online
  • Mention: Hosted server tier inquiry

---

Technical Specifications

Package Contents:

  • upload.php - Data collection endpoint
  • health.php - Health check endpoint
  • install.php - Installation wizard (delete after setup)
  • config.php - Generated configuration (created by installer)
  • admin/ - Admin panel files
  • lib/ - Utility libraries
  • data/ - Token management (approvedtokens.csv)
  • uploads/ - Data storage directory

File Storage Structure:

uploads/
├── {studytoken}/
│ ├── {participant
id}/
│ │ ├── {test1}data.csv
│ │ └── {test2}
data.json
│ └── {participantid}/
└── {study
token}/

API Endpoints:

  • POST /upload.php - Data collection
  • GET /health.php - Server status
  • GET /admin/ - Admin dashboard
  • GET /admin/manage_tokens.php - Token management

---

Next Steps

  1. Download the package from PEBL Hub downloads
  2. Review server requirements and prepare your hosting
  3. Follow installation wizard step-by-step
  4. Configure a test study to verify setup
  5. Run a test session and check that files appear
  6. Set up regular backups of your uploads directory
  7. Document your setup for compliance records
  8. Delete install.php for security

Questions? Contact support@peblhub.online

---

Last Updated: February 7, 2026 Document Version: 2.0 Tier Requirement: Research+ with Hosted Server Download: Available on the Downloads page


Related Topics