How to deploy Halo in CentOS VPS

  1. Install Nginx in VPS

  2. Install Java

    sudo yum install java-11-openjdk -y // install java
    java -version // check version
  3. Create a new halo user

    useradd -m halo // new user
    usermod -aG wheel halo // grant permission
    passwd halo // set password
    su - halo // switch user
  4. Download halo.jar

    mkdir ~/app && cd ~/app // download
    wget https://dl.halo.run/release/halo-1.4.7.jar -O halo.jar // run
  5. Configure working directory

    mkdir ~/.halo && cd ~/.halo
    // configuration file
    wget https://dl.halo.run/config/application-template.yaml -O ./application.yaml
    vim application.yaml
  6. Launch halo

    cd ~/app && java -jar halo.jar

What if can't visit halo use ip:port?

  1. check port firewall
    firewall-cmd --query-port=8090/tcp --zone=public
  2. enable port
    firewall-cmd --zone=public --add-port=8090/tcp --permanent
  3. restart firewall

    firewall-cmd --reload

    Keep Halo running in VPS

    1. Log in root usr

      exit
    2. Download halo service

      wget https://dl.halo.run/config/halo.service -O /etc/systemd/system/halo.service
    3. Change configuration

      vim /etc/systemd/system/halo.service
      YOUR_JAR_PATH -> /home/halo/app/halo.jar
      USER  -> halo
    4. reload

      systemctl daemon-reload
    5. Run service

      systemctl start halo
    6. Enable halo when service run

      systemctl enable halo

For more information, feel free to reach out Doc link.

Leave a Reply