Era Host hosting
EraHost – Free Domain, Cheap Hosting!
Client Area
Support 24/7
Menu

Osclass Hosting — A Complete Guide for System Administrators

4 min read
01.03.2026

What is Osclass?

Osclass is an open-source classified ads script that allows users to create and manage their own classified ad websites for various niches, including:

Osclass Hosting System Administrator Guide
Osclass — open-source classifieds CMS for self-hosted listing sites.

For related CMS-on-VPS install topics, see Bitrix Virtual Appliance (BitrixVA) and "Installation already exists" — Softaculous Reinstall Fix.

  • Real estate
  • Job listings
  • Auto sales
  • General marketplace

Since Osclass is self-hosted, you need a server environment that supports its PHP and MySQL requirements.

Choose the Right Hosting Environment

Osclass runs best on LAMP (Linux, Apache, MySQL, PHP) or LEMP (Linux, Nginx, MySQL, PHP) stack.

Minimum Hosting Requirements

Component Minimum Requirement
OS Ubuntu 20.04+, CentOS 7+, Debian 10+
Web Server Apache 2.4+ or Nginx 1.18+
PHP 7.4+ (8.0 recommended)
Database MySQL 5.7+ or MariaDB 10+
RAM 2GB+ (4GB+ for high traffic)

VPS is recommended for better performance and scalability instead of shared hosting.

Setting Up a VPS for Osclass

If you are setting up a dedicated server or VPS, follow these steps:

Update the Server

sudo apt update && sudo apt upgrade -y

Install Required Packages

For LAMP Stack (Apache + MySQL + PHP)

sudo apt install apache2 mariadb-server php php-mysql php-xml php-mbstring php-gd unzip -y

For LEMP Stack (Nginx + MySQL + PHP)

sudo apt install nginx mariadb-server php php-fpm php-mysql php-xml php-mbstring php-gd unzip -y
Linux VDS
High performance for your projects
  • Root access and flexible setup
  • Control panel
  • NVMe disks
  • DDR5
Linux VDS

Install Osclass

Download the Latest Osclass Version

cd /var/www/
wget https://github.com/navjottomer/Osclass/releases/latest/download/osclass.zip
unzip osclass.zip -d osclass
rm osclass.zip

Set Permissions

sudo chown -R www-data:www-data /var/www/osclass
sudo chmod -R 755 /var/www/osclass

Configure Apache or Nginx

For Apache:

  1. Create a Virtual Host:
    sudo nano /etc/apache2/sites-available/osclass.conf
  2. Add the following configuration:
    <VirtualHost *:80>
        ServerAdmin admin@example.com
        DocumentRoot /var/www/osclass
        ServerName yourdomain.com
        ServerAlias www.yourdomain.com
    
        <Directory /var/www/osclass>
            AllowOverride All
            Require all granted
        </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>
  3. Enable and Restart Apache:
    sudo a2ensite osclass.conf
    sudo systemctl restart apache2

For Nginx:

  1. Create a new configuration file:
    sudo nano /etc/nginx/sites-available/osclass
  2. Add the following:
    server {
        listen 80;
        server_name yourdomain.com www.yourdomain.com;
    
        root /var/www/osclass;
        index index.php index.html index.htm;
    
        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }
    
        location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php-fpm.sock;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
        }
    }
  3. Enable and Restart Nginx:
    sudo ln -s /etc/nginx/sites-available/osclass /etc/nginx/sites-enabled/
    sudo systemctl restart nginx

Configure Database for Osclass

  1. Secure MySQL Installation:
    sudo mysql_secure_installation

    Follow the prompts to remove default settings and set a root password.

  2. Create a Database for Osclass:
    sudo mysql -u root -p

    Then run:

    CREATE DATABASE osclass_db;
    CREATE USER 'osclass_user'@'localhost' IDENTIFIED BY 'strongpassword';
    GRANT ALL PRIVILEGES ON osclass_db.* TO 'osclass_user'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;

Install Osclass via Web Browser

  1. Open your browser and go to:
    http://yourdomain.com/
  2. Follow the installation wizard:
    • Enter the database name, user, and password.
    • Set up the admin account.
    • Complete the setup.

Secure Osclass and Optimize Performance

Secure Osclass Admin Panel

  • Change the default admin URL from /oc-admin/ to something unique.
  • Restrict access using IP whitelisting.

Enable SSL for HTTPS

If using Apache:

sudo a2enmod ssl
sudo systemctl restart apache2

For Nginx, add:

listen 443 ssl;
ssl_certificate /etc/ssl/certs/yourdomain.pem;
ssl_certificate_key /etc/ssl/private/yourdomain.key;

Then restart Nginx:

sudo systemctl restart nginx

Optimize PHP & Database Performance

  • Increase PHP execution limits in php.ini:
    memory_limit = 256M
    max_execution_time = 300
  • Optimize MySQL settings:
    sudo mysqltuner

Summary of Steps

Step Action
1 Set up a VPS with LAMP or LEMP stack
2 Download and configure Osclass
3 Configure Apache or Nginx
4 Set up a MySQL database
5 Install Osclass through a web browser
6 Secure and optimize performance

Troubleshooting Common Issues

Issue Solution
500 Internal Server Error Check Apache/Nginx error logs (/var/log/apache2/error.log or /var/log/nginx/error.log).
Database Connection Failed Ensure the database name, user, and password are correct in Osclass settings.
File Permission Errors Run sudo chown -R www-data:www-data /var/www/osclass.
Slow Performance Enable caching and optimize MySQL settings.
SSL Not Working Ensure the SSL certificate is correctly installed and enabled.

By following these detailed steps, you can successfully host Osclass on your own VPS or dedicated server, ensuring a fast, secure, and scalable classified ads website.

Frequently asked questions
Tiny classifieds site (< 1000 listings, low traffic): shared with PHP 7.4+ and MySQL 5.7+ is fine. Once you're past 5000 listings or expect search-heavy traffic, the MySQL queries Osclass runs get expensive — VPS lets you tune InnoDB buffers and run Memcached/Redis as cache. Image-heavy sites also need disk space and processing power shared often caps.
The mainline Osclass codebase supports PHP 7.4-8.1; 8.2+ trips deprecation warnings in some plugins. The fork osclass.io tracks PHP 8.2/8.3 better. Pick PHP version based on which branch you're running — and pin it via the panel rather than relying on a system default.
PHP `upload_max_filesize` and `post_max_size` in php.ini (Osclass typical default 8M is too low for modern photos). Then check writable permissions on `oc-content/uploads/`: should be writable by the web user (`www-data:www-data` 775 typical). Then `LimitRequestBody` in Apache or `client_max_body_size` in nginx. Three places, one of them is usually the cap.
Default MySQL LIKE-based search is O(N) — slow past a few thousand listings. Install a search plugin that uses Sphinx or MySQL fulltext indexing. Or — better at scale — run Elasticsearch and an Osclass plugin to dual-write. For a budget fix, just adding the right MySQL indexes on `oc_t_item.fk_i_user_id` and search columns and increasing `innodb_buffer_pool_size` helps.
Related articles
Best Hosting Options for Mautic — Self-Hosted Marketing Automation
Revisium Antivirus Overview: Complete Website Security Solution
SMTP Hosting: Setup and Usage Guide