Follow Us:

Custom Application on Bitnami using Virtual Hosts & Apache

Bitnami is a library of software packages that help build Web Applications efficiently. Generally, users deploy Bitnami to host WordPress. Bitnami uses the Apache server to host Web Applications. However, the Virtual Hosts configuration is different on Bitnami than on a traditional Apache Server.

In this tutorial, we have an existing application, i.e.,, and we will set up an additional web application, for example, We can set up an additional server for However, we will use the resources of the same Bitnami server to avoid additional costs and administrations. Let’s get started!


The default approach to add Virtual Hosts in Apache

Usually, we use configure DNS mapping the additional applications. Further, we need to set up the Virtual Hosts configurations. The default Virtual Hosts configuration is available /etc/apache2/sites-available/.

To add a web application, such as, we need to navigate to /etc/apache2/sites-available/ and create a new file as below:

cd /etc/apache2/sites-available/

Now, use your text editor and set the below information into the file.

<VirtualHost *:80>
     DocumentRoot /var/www/

Save this Virtual Hosts file, and to enable our application, we will use the a2ensite and restart the Apache web server.

service apache2 restart

The Bitnami approach to define custom web applications

The approach is different to define Virtual Hosts in a Bitnami web server. Bitnami manages the Virtual Hosts configuration files under the /opt/bitnami/apache/conf/vhosts/ directory. Similarly, all bitnami applications are available under /opt/bitnami/ directory.

First, we need to create an application directory under the /opt/bitnami/. You can directly use the below command to create it:

sudo mkdir -p /opt/bitnami/

Now, let’s create an HTML file, i.e., index.html under the /opt/bitnami/ directory and define a web page.

sudo nano /opt/bitnami/
        <title>Welcome to Bitnami Application </title>
        <h1>Success! Custom application is working!</h1>

Save the file, and change the permission of the newly created application:

sudo chown bitnami:daemon -R /opt/bitnami/

That’s it! We have completed the definition of our custom application.

Define the Virtual Hosts on the Bitnami Server

Here, we will add the Virtual Hosts for the custom application. We will use the below command to create a custom Virtual Hosts file for the

sudo touch /opt/bitnami/apache/conf/vhosts/

Now, add the Virtual Hosts configuration into /opt/bitnami/apache/conf/vhosts/

Ensure that the virtual host file name is ending with *vhost.conf!

sudo nano /opt/bitnami/apache/conf/vhosts/
<VirtualHost *:80>
    DocumentRoot /opt/bitnami/
    <Directory "/opt/bitnami/">
      Options -Indexes +FollowSymLinks -MultiViews
      AllowOverride All
      Require all granted

You can also define one more Virtual Hosts file to access the custom application using HTTPS. If you own the custom application domain, you may request a free SSL certificate from Let’s Encrypt.

<VirtualHost *:443>
    ServerAlias *
    DocumentRoot /opt/bitnami/
    SSLEngine on
    SSLCertificateFile "/opt/bitnami/apache/conf/"
    SSLCertificateKeyFile "/opt/bitnami/apache/conf/"
    <Directory "/opt/bitnami/">
      Options -Indexes +FollowSymLinks -MultiViews
      AllowOverride All
      Require all granted

Let’s create a DNS mapping to access your custom application using fqdn. You can configure A record (Address record ) on your domain provider portal. If you can’t access the domain provider portal, add a host entry to your system.

For Linux systems, use the below command to add a localhost entry:

sudo echo "" >> /etc/hosts

For the Windows system, you need to edit the C:\Windows\System32\drivers\etc\hosts file using a text editor with administrative privileges.

Restarting the Apache on Bitnami Server

Finally, we need to restart the Apache on the Bitnmai server to make our custom application effective. However, restarting of Apache server is different on Bitnami. You can use the below command to restart the Apache Server:

sudo /opt/bitnami/ restart apache

We have completed the process of defining the custom application on bitnami. You can access it on your web browser using


Further Reading


In this article, we have successfully deployed a custom web application on Bitnami Server. You can set up a new custom application by defining the application directory under /opt/bitnmai/ and virtual host configuration under /opt/bitnami/apache/conf/vhosts/.

I hope this article is easy to understand. If this article is helpful, please share it on social media platforms.

Leave a Reply

Your email address will not be published. Required fields are marked *

Copy link is now!