# CloudStack Management Server (Standalone)

## Prepare the Operating System[](https://docs.cloudstack.apache.org/en/4.21.0.0/installguide/management-server/index.html#prepare-the-operating-system "Link to this heading")

The OS must be prepared to host the Management Server using the following steps. These steps must be performed on each Management Server node.

1. Log in to your OS as root.
2. Check for a fully qualified hostname.
    
    ```
    hostname --fqdn
    ```
    
    This should return a fully qualified hostname such as “management1.lab.example.org”. If it does not, edit /etc/hosts so that it does.
3. Make sure that the machine can reach the Internet.
    
    ```
    ping cloudstack.apache.org
    ```
4. Turn on NTP for time synchronization.
    
    Note
    
    An NTP daemon is required to synchronize the clocks of the servers in your cloud.
    
    Install chrony.
    
    In RHEL or CentOS:
    
    > ```
    > $ yum install chrony
    > ```
    
    n RHEL or CentOS:
    
    Yum repository information is found under `<span class="pre">/etc/yum.repos.d</span>`. You’ll see several `<span class="pre">.repo</span>` files in this directory, each one denoting a specific repository.
    
    To add the CloudStack repository, create `<span class="pre">/etc/yum.repos.d/cloudstack.repo</span>` and insert the following information.
    
    In the case of RHEL being used, you can replace ‘centos’ by ‘rhel’ in the value of baseurl
    
    ```
    [cloudstack]
    name=cloudstack
    baseurl=http://download.cloudstack.org/centos/$releasever/4.21/
    enabled=1
    gpgcheck=0
    ```
    
    <section id="bkmrk-now-update-your-loca"><section id="bkmrk-now-update-your-loca-1">Now update your local apt cache.
    
    ```
    sudo apt update
    ```
    
    Your DEB package repository should now be configured and ready for use.
    
    </section></section><section id="bkmrk-install-on-centos%2Frh">### Install on CentOS/RHEL[](https://docs.cloudstack.apache.org/en/4.21.0.0/installguide/management-server/index.html#install-on-centos-rhel "Link to this heading")
    
    ```
    yum install cloudstack-management
    ```
    
    </section>## Step #2: Install MariaDB
    
    AlmaLinux 9 provides a MariaDB package directly in its official repositories. To install the MariaDB server with all necessary dependencies, execute the following command:
    
    > *sudo dnf install mariadb-server -y*
    
    Open the MySQL configuration file. The configuration file is `<span class="pre">/etc/my.cnf.d/mariadb-server.cnf</span>`.
    
    Insert the following lines in the `<span class="pre">[mysqld]</span>` section.
    
    You can put these lines below the datadir line. The max\_connections parameter should be set to 350 multiplied by the number of Management Servers you are deploying. This example assumes one Management Server.
    
    ```mysql
    innodb_rollback_on_timeout=1
    innodb_lock_wait_timeout=600
    max_connections=350
    log_bin=mysql-bin
    binlog_format=ROW
    ```
    
    ## Start and Enable the MariaDB Service
    
    Once you have installed the MariaDB package, start and enable the service to launch automatically on the system boot.
    
    > *\# sudo systemctl start mariadb*
    > 
    > # *sudo systemctl enable mariadb*
    
    Run the following command to secure your installation. You can answer “Y” to all questions.
    
    ```
    mysql_secure_installation
    ```
    
    loudStack can be blocked by security mechanisms, such as SELinux. Disable SELinux to ensure + that the Agent has all the required permissions.
    
    Configure SELinux (RHEL and CentOS):
    
    
    1. Check whether SELinux is installed on your machine. If not, you can skip this section.
        
        In RHEL or CentOS, SELinux is installed and enabled by default. You can verify this with:
        
        ```
        rpm -qa | grep selinux
        ```
        
        
        1. Set the SELINUX variable in `<span class="pre">/etc/selinux/config</span>` to “permissive”. This ensures that the permissive setting will be maintained after a system reboot.
            
            In RHEL or CentOS:
            
            ```
            vi /etc/selinux/config
            ```
            
            Change the following line
            
            ```
            SELINUX=enforcing
            ```
            
            to this:
            
            ```
            SELINUX=permissive
            ```
        2. Set SELinux to permissive starting immediately, without requiring a system reboot.
            
            ```
            setenforce permissive
            ```
            
            In a production environment, selinux should be set to enforcing and the necessary selinux policies are created to allow the services to run.