Web server requirements for a small PHP community: a practical checklist

#hosting #php #server

No replies · 0 views · started 52 minutes ago · 2 min read

GumSlone Administrator Principal · 1,698 posts #1

Planning to host a PHP forum or community site? Here's what you actually need for a small community: up to a few thousand members and a few hundred people online at once.

Hardware (VPS)

  • CPU: 2 vCPU to start, 4 for headroom.
  • RAM: 2 GB minimum, 4 GB recommended. The database and PHP workers use most of it.
  • Disk: 40–80 GB SSD or NVMe. Uploads and backups grow over time.
  • Bandwidth: 1–2 TB a month is plenty, and almost every VPS includes it.
  • Cost: about €5–15 a month at Hetzner, OVH, Netcup or DigitalOcean.

Software

  • OS: Ubuntu 24.04 LTS or Debian 12.
  • Web server:
    • Nginx or Caddy with PHP-FPM is the classic, light setup.
    • FrankenPHP in worker mode if you want speed and built-in HTTPS.
    • Apache works too, but uses more memory.
  • PHP: 8.3 or newer, with OPcache on.
    • Common extensions: pdo_mysql, mbstring, intl, gd or imagick, curl, zip, xml, bcmath, redis.
  • Database: MariaDB 10.11+ or MySQL 8. Set innodb_buffer_pool_size to about half your RAM.
  • Cache and queues: Redis, which also handles sessions and rate limits.
  • HTTPS: a free Let's Encrypt certificate (Caddy and FrankenPHP do it automatically).

PHP-FPM settings for 4 GB RAM

pm = dynamic
pm.max_children = 24
memory_limit = 256M
upload_max_filesize = 20M
post_max_size = 20M
opcache.memory_consumption = 192

Mail

  • Send through an SMTP relay instead of straight from the server, or your mail ends up in spam. Options include Brevo, Mailgun, Amazon SES or Postmark.
  • Set up SPF, DKIM and DMARC records for your domain.

Security

  • Firewall: allow only ports 22, 80 and 443.
  • SSH: key-only logins with root login disabled; fail2ban on SSH and login pages.
  • Updates: turn on automatic security updates (unattended-upgrades).
  • Users: run PHP as its own user, not root, and not a user shared with other sites.
  • Uploads: never execute uploaded files; turn PHP off in upload folders.
  • Optional: Cloudflare in front for DDoS protection and caching.

Backups and monitoring

  • Database: a nightly dump copied off the server (S3, Backblaze B2 or similar), kept for 7–30 days. A backup on the same server is not a backup.
  • Files: a weekly copy of uploads and config.
  • Monitoring: a free uptime check (UptimeRobot or similar) and a disk-space alert.

Rough guide to how far it goes

  • 2 GB RAM: around 50 people online at once.
  • 4 GB RAM: a few hundred, which is enough for most small communities.
  • 8 GB+ or a separate database server: heavy traffic or search.

Start small: a 4 GB VPS with Nginx or Caddy, PHP 8.3, MariaDB and Redis will carry most communities for years. Upgrade when the numbers tell you to, not before.

What are you running your community on? Post your setup below.

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close