Skip to main content

Security Overview

Securing your self-hosted AppFlowy instance is critical to protect your data and ensure compliance with security standards.

Network Security

SSL/TLS encryption and firewall configuration

Authentication

Strong authentication and access controls

Data Protection

Encryption at rest and in transit

Monitoring

Audit logs and security monitoring

SSL/TLS Configuration

Let’s Encrypt provides free SSL certificates with automatic renewal.
1

Install Certbot

2

Obtain SSL certificate

Follow the interactive prompts:
  • Enter your email address
  • Agree to terms of service
  • Choose whether to redirect HTTP to HTTPS (recommended: Yes)
3

Verify certificate installation

Check the expiry date and renewal status.
4

Test automatic renewal

5

Configure auto-renewal

Certbot automatically sets up a systemd timer. Verify it:
Ensure ports 80 and 443 are open in your firewall before obtaining certificates.

Using Custom SSL Certificates

If you have your own SSL certificates:
1

Copy certificates to the server

2

Set proper permissions

3

Update Nginx configuration

Edit /etc/nginx/sites-available/appflowy:
4

Test and reload Nginx

SSL Best Practices

Enhanced SSL/TLS configuration for maximum security:
Generate DH parameters:

Authentication Configuration

Strong Password Policies

Enforce strong passwords in GoTrue configuration:

Multi-Factor Authentication (MFA)

Enable MFA for enhanced security:
MFA significantly reduces the risk of unauthorized access, even if passwords are compromised.

Session Management

Configure secure session handling:

Single Sign-On (SSO)

Integrate with your organization’s SSO:

Data Encryption

Encryption at Rest

1

Enable PostgreSQL encryption

Use encrypted volumes for database storage:
Or use PostgreSQL’s built-in encryption:
2

Encrypt S3 storage

For MinIO:
For AWS S3:
3

Encrypt Redis persistence

Encryption in Transit

All communication should use TLS:
Never transmit credentials or sensitive data over unencrypted connections.

Firewall Configuration

Configure firewall rules to limit access:
1

Install UFW (Ubuntu)

2

Configure default policies

3

Allow necessary ports

4

Restrict database access

5

Enable firewall

Docker Network Isolation

Isolate services using Docker networks:

Security Headers

Add security headers in Nginx:

Backup Recommendations

Automated Database Backups

1

Create backup script

Create /usr/local/bin/backup-appflowy.sh:
Make it executable:
2

Schedule with cron

Add daily backup at 2 AM:
3

Test backup restoration

Off-Site Backup Storage

Store backups remotely for disaster recovery:
Encrypt backups before storing off-site. Test your backup restoration process regularly.

Audit Logging

Enable comprehensive audit logging:

Centralized Logging

Forward logs to a centralized system:

Security Monitoring

Intrusion Detection

Install and configure Fail2ban:
1

Install Fail2ban

2

Configure for Nginx

Create /etc/fail2ban/jail.local:
3

Restart Fail2ban

Security Scanning

Regularly scan for vulnerabilities:

Compliance & Standards

GDPR Compliance

  • Enable data export functionality
  • Implement data deletion procedures
  • Maintain audit logs for data access
  • Document data processing activities

SOC 2

  • Implement access controls
  • Enable comprehensive logging
  • Regular security assessments
  • Incident response procedures

HIPAA

  • Encrypt all PHI data
  • Implement BAA agreements
  • Audit trail requirements
  • Regular risk assessments

ISO 27001

  • Information security policies
  • Risk management framework
  • Security awareness training
  • Continuous improvement

Security Checklist

Use this checklist to verify your security configuration:
  • SSL/TLS certificates installed and auto-renewal configured
  • Firewall rules configured to restrict access
  • Strong passwords enforced (12+ characters)
  • Multi-factor authentication enabled
  • Database encryption at rest enabled
  • Regular automated backups configured
  • Off-site backup storage configured
  • Audit logging enabled
  • Security headers configured
  • Docker network isolation implemented
  • Fail2ban or similar IDS installed
  • Regular security updates scheduled
  • Incident response plan documented
  • Regular security assessments scheduled

Security Best Practices

Principle of Least Privilege

Grant users only the minimum permissions necessary for their role.

Regular Updates

Keep all components updated with the latest security patches.

Defense in Depth

Implement multiple layers of security controls.

Security Monitoring

Continuously monitor for security events and anomalies.

Incident Response

Prepare for security incidents:
1

Document procedures

Create an incident response plan including:
  • Contact information for security team
  • Escalation procedures
  • Containment strategies
  • Recovery procedures
2

Regular drills

Practice incident response procedures quarterly.
3

Post-incident review

After any security event, conduct a review and update procedures.
Security is an ongoing process, not a one-time setup. Regularly review and update your security posture.

Getting Help

Report Security Issues

Report security vulnerabilities responsibly

Community Support

Join our Discord for security discussions

Documentation

Review self-hosting documentation

Professional Services

Contact us for security consulting