Starting Hexo On Boot

  1. Create a shell script to execute the Hexo server.

    1
    2
    cd ~
    nano starthexo.sh

    The contents can be as simple as the following:

    1
    2
    3
    #!/bin/bash
    cd /path/to/hexo/workspace
    hexo server
  2. Make the script executable.

    1
    chmod u+x starthexo.sh
  3. Edit your user’s crontab file to start Hexo on boot.

    1
    crontab -u myusername -e

    Add the following line to the bottom of your crontab file.

    1
    @reboot sh starthexo.sh
Share Comments