Osclass Hosting — A Complete Guide for System Administrators
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:
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
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:
- Create a Virtual Host:
sudo nano /etc/apache2/sites-available/osclass.conf - 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> - Enable and Restart Apache:
sudo a2ensite osclass.conf sudo systemctl restart apache2
For Nginx:
- Create a new configuration file:
sudo nano /etc/nginx/sites-available/osclass - 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; } } - Enable and Restart Nginx:
sudo ln -s /etc/nginx/sites-available/osclass /etc/nginx/sites-enabled/ sudo systemctl restart nginx
Configure Database for Osclass
- Secure MySQL Installation:
sudo mysql_secure_installationFollow the prompts to remove default settings and set a root password.
- Create a Database for Osclass:
sudo mysql -u root -pThen 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
- Open your browser and go to:
http://yourdomain.com/ - 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.


