Deploying OSSN
Introduction
OSSN (Open Source Social Network) is a feature-rich social networking platform that allows you to build your own social network similar to Facebook. It provides all the essential social networking features including user profiles, friend connections, groups, messaging, photos, and a news feed.
Built with PHP, OSSN offers a clean, responsive interface and an extensible architecture through components and themes. It’s designed for organizations, communities, or anyone who wants to run their own private social network with full control over data and privacy.
Key highlights of OSSN:
- User Profiles: Customizable user profiles with photos and information
- Friends System: Friend requests, connections, and activity feeds
- Groups: Public and private groups with discussions
- Messaging: Private messaging between users
- Photo Sharing: Photo albums and image uploads
- News Feed: Activity stream showing updates from connections
- Notifications: Real-time notifications for activities
- Comments and Likes: Social interactions on posts
- Privacy Controls: Granular privacy settings for users
- Component System: Extend functionality with add-ons
- Theme Support: Customizable appearance
- Open Source: GPL-2.0 license with active development
This guide walks through deploying OSSN on Klutch.sh using Docker.
Why Deploy OSSN on Klutch.sh
Deploying OSSN on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh handles the PHP/MySQL deployment automatically.
Persistent Storage: Attach persistent volumes for user data and uploads.
HTTPS by Default: Automatic SSL certificates for secure social networking.
GitHub Integration: Version-controlled deployments through your repository.
Scalable Resources: Allocate CPU and memory based on your community size.
Environment Variable Management: Securely store database credentials.
Custom Domains: Use your own domain for your social network.
Always-On Availability: Your social network remains accessible 24/7.
Prerequisites
Before deploying OSSN on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- A MySQL/MariaDB database
- (Optional) A custom domain for your OSSN instance
Understanding OSSN Architecture
OSSN uses a traditional LAMP-style architecture:
PHP Application: Core application handling all business logic and rendering.
MySQL Database: Stores users, posts, relationships, and all application data.
File Storage: User uploads including profile pictures and shared photos.
Component System: Modular add-ons for extending functionality.
Theme Engine: Customizable templates for appearance changes.
Deploying OSSN on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 80
- Navigate to
https://your-app.klutch.sh - Follow the installation wizard
- Enter database credentials
- Create admin account
Create Your GitHub Repository
Create a new GitHub repository for your OSSN deployment configuration.
Create the Dockerfile
Create a Dockerfile in your repository root:
FROM php:8.1-apache
# Install dependenciesRUN apt-get update && apt-get install -y \ libpng-dev \ libjpeg-dev \ libfreetype6-dev \ libzip-dev \ unzip \ curl \ && rm -rf /var/lib/apt/lists/*
# Configure PHP extensionsRUN docker-php-ext-configure gd --with-freetype --with-jpeg && \ docker-php-ext-install gd mysqli zip pdo pdo_mysql
# Enable Apache mod_rewriteRUN a2enmod rewrite
# Configure PHPRUN { \ echo 'upload_max_filesize = 100M'; \ echo 'post_max_size = 100M'; \ echo 'memory_limit = 256M'; \ echo 'max_execution_time = 300'; \} > /usr/local/etc/php/conf.d/ossn.ini
# Download OSSNWORKDIR /var/www/htmlRUN curl -L https://github.com/nicksellen/ossn/archive/refs/heads/master.zip -o ossn.zip && \ unzip ossn.zip && \ mv ossn-master/* . && \ rm -rf ossn-master ossn.zip
# Set permissionsRUN chown -R www-data:www-data /var/www/html && \ chmod -R 755 /var/www/html
# Create data directoryRUN mkdir -p /var/ossn_data && \ chown www-data:www-data /var/ossn_data
EXPOSE 80Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project.
Create a New App
Within your project, create a new app and connect your GitHub repository.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Configure the following environment variables:
| Variable | Value |
|---|---|
MYSQL_HOST | Your database host |
MYSQL_DATABASE | ossn |
MYSQL_USER | Database username |
MYSQL_PASSWORD | Database password |
Attach Persistent Volumes
Add persistent storage:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/var/www/html | 5 GB | OSSN installation |
/var/ossn_data | 50 GB | User uploads and data |
Deploy Your Application
Click Deploy to start the build process.
Complete Installation Wizard
Access your OSSN instance and complete setup:
Initial Configuration
Site Configuration
After installation, configure your network:
- Log in as administrator
- Go to Administrator Dashboard
- Configure site name and settings
- Set up default privacy options
Email Configuration
Set up email notifications:
- Navigate to Site Settings
- Configure SMTP settings
- Test email delivery
- Enable notification types
Enabling Components
Extend functionality:
- Go to Components section
- Browse available components
- Enable desired features
- Configure component settings
Customizing OSSN
Theme Customization
Change the appearance:
- Navigate to Themes
- Browse available themes
- Install and activate themes
- Customize colors and styles
Custom Pages
Create additional content:
- Use the pages component
- Create About, Terms, Privacy pages
- Add custom navigation links
Privacy Settings
Configure network privacy:
- Set registration requirements
- Configure default privacy levels
- Enable/disable features for users
- Set content moderation rules
Managing Your Network
User Management
Administer users:
- View all registered users
- Manage user roles
- Handle user reports
- Moderate content
Content Moderation
Keep your network safe:
- Enable content reporting
- Review reported content
- Take moderation actions
- Configure automated filters
Groups Administration
Manage groups:
- View all groups
- Approve group requests
- Moderate group content
- Set group policies
Production Best Practices
Performance Optimization
- Enable PHP OPcache
- Configure MySQL query caching
- Use CDN for static assets
- Optimize images on upload
Security Recommendations
- Keep OSSN and components updated
- Use strong admin passwords
- Enable HTTPS (automatic on Klutch.sh)
- Regular security audits
- Configure rate limiting
Backup Strategy
- Database Backups: Regular MySQL dumps
- File Backups: Back up
/var/ossn_data - Configuration: Document all settings
- Test Restores: Verify backup integrity
Troubleshooting Common Issues
Installation Fails
- Verify database connectivity
- Check file permissions
- Review PHP error logs
- Ensure extensions installed
Upload Issues
- Check PHP upload limits
- Verify data directory permissions
- Check available disk space
- Review error logs
Performance Problems
- Increase PHP memory limit
- Optimize database
- Enable caching
- Check server resources
Additional Resources
Conclusion
Deploying OSSN on Klutch.sh provides a complete social networking platform with full control over your data and community. Whether building a private network for your organization or a public community platform, OSSN offers the features users expect from modern social networks while maintaining privacy and independence from major platforms.