<\/span><\/h2>\r\n\r\n\r\n\r\nFirst, log in to your Ubuntu 20.04 server via SSH as the root user:<\/p>\r\n\r\n\r\n\r\n
ssh root@IP_Address -p Port_number<\/pre>\r\n\r\n\r\n\r\nYou will need to replace \u2018IP_Address\u2018 and \u2018Port_number\u2018 with your server\u2019s respective IP address and SSH port number. Additionally, replace \u2018root\u2019 with the username of the admin account if necessary.<\/p>\r\n\r\n\r\n\r\n
Before starting, you have to make sure that all Ubuntu OS packages installed on the server are up to date. You can do this by running the following commands:<\/p>\r\n\r\n\r\n\r\n
apt-get update -y\r\napt-get upgrade -y<\/pre>\r\n\r\n\r\n\r\n<\/span>Step 2: Install Node.js<\/span><\/h2>\r\n\r\n\r\n\r\nReveal.js is built on Node.js. So you will need to install Node.js in your server. By default, the latest version of Node.js is not available in the Ubuntu 20.04 default repository. So you will need to add the Node.js official repository to your system.<\/p>\r\n\r\n\r\n\r\n
First, install all the required dependencies with the following command:<\/p>\r\n\r\n\r\n\r\n
apt-get install curl gnupg2 unzip git -y<\/pre>\r\n\r\n\r\n\r\nOnce all the dependencies are installed, add the Node.js repository with the following command:<\/p>\r\n\r\n\r\n\r\n
curl -sL https:\/\/deb.nodesource.com\/setup_14.x | bash -<\/pre>\r\n\r\n\r\n\r\nNext, install Node.js by running the following command:<\/p>\r\n\r\n\r\n\r\n
apt-get install nodejs -y<\/pre>\r\n\r\n\r\n\r\nOnce Node.js is installed, you can verify the Node.js version with the following command:<\/p>\r\n\r\n\r\n\r\n
node -v<\/pre>\r\n\r\n\r\n\r\nYou should get the following output:<\/p>\r\n\r\n\r\n\r\n
v14.15.0\r\n<\/pre>\r\n\r\n\r\n\r\n<\/span>Step 3: Install Reveal.js<\/span><\/h2>\r\n\r\n\r\n\r\nFirst, download the latest version of Reveal.js from the Git repository using the following command:<\/p>\r\n\r\n\r\n\r\n
git clone git clone https:\/\/github.com\/hakimel\/reveal.js.git<\/pre>\r\n\r\n\r\n\r\nOnce the download is completed, change the directory to reveal.js and install all dependencies with the following command:<\/p>\r\n\r\n\r\n\r\n
cd reveal.js\r\nnpm install<\/pre>\r\n\r\n\r\n\r\nOnce all the dependencies are installed, start the Node server with the following command:<\/p>\r\n\r\n\r\n\r\n
npm start<\/pre>\r\n\r\n\r\n\r\nYou should get the following output:<\/p>\r\n\r\n\r\n\r\n
> reveal.js@4.1.0 start \/root\/reveal.js\r\n> gulp serve\r\n\r\n[10:01:50] Using gulpfile ~\/reveal.js\/gulpfile.js\r\n[10:01:50] Starting 'serve'...\r\n[10:01:50] Starting server...\r\n[10:01:50] Server started http:\/\/0.0.0.0:8000\r\n[10:01:50] LiveReload started on port 35729\r\n[10:01:50] Running server\r\n<\/pre>\r\n\r\n\r\n\r\nAt this point, your development server is started and listening on port 8000.<\/p>\r\n\r\n\r\n\r\n
Now, press CTRL+C to stop the running server.<\/p>\r\n\r\n\r\n\r\n
<\/span>Step 4: Create a Systemd Service File for Reveal.js<\/span><\/h2>\r\n\r\n\r\n\r\nNext, you will need to create a systemd service file to manage the Reveal.js service. You can create it with the following command:<\/p>\r\n\r\n\r\n\r\n
nano \/lib\/systemd\/system\/reveal.service<\/pre>\r\n\r\n\r\n\r\nAdd the following lines:<\/p>\r\n\r\n\r\n\r\n
[Service]\r\nType=simple\r\nUser=root\r\nRestart=on-failure\r\nWorkingDirectory=\/root\/reveal.js\r\nExecStart=npm start -- --port=8001\r\n<\/pre>\r\n\r\n\r\n\r\nSave and close the file then reload the systemd service with the following command:<\/p>\r\n\r\n\r\n\r\n
systemctl daemon-reload<\/pre>\r\n\r\n\r\n\r\nNext, start the Reveal.js service and enable it to start at system reboot with the following command:<\/p>\r\n\r\n\r\n\r\n
systemctl start reveal\r\nsystemctl enable reveal<\/pre>\r\n\r\n\r\n\r\nYou can also verify the status of the service with the following command:<\/p>\r\n\r\n\r\n\r\n
systemctl status reveal<\/pre>\r\n\r\n\r\n\r\nYou should get the following output:<\/p>\r\n\r\n\r\n\r\n
\u25cf reveal.service\r\n Loaded: loaded (\/lib\/systemd\/system\/reveal.service; static; vendor preset: enabled)\r\n Active: active (running) since Sun 2020-11-15 10:05:47 UTC; 4s ago\r\n Main PID: 3912 (node)\r\n Tasks: 23 (limit: 2353)\r\n Memory: 89.1M\r\n CGroup: \/system.slice\/reveal.service\r\n \u251c\u25003912 npm\r\n \u251c\u25003938 sh -c gulp serve\r\n \u2514\u25003939 gulp serve\r\n\r\nNov 15 10:05:47 ubuntu2004 systemd[1]: Started reveal.service.\r\nNov 15 10:05:47 ubuntu2004 npm[3912]: > reveal.js@4.1.0 start \/root\/reveal.js\r\nNov 15 10:05:47 ubuntu2004 npm[3912]: > gulp serve\r\nNov 15 10:05:49 ubuntu2004 npm[3939]: [10:05:49] Using gulpfile ~\/reveal.js\/gulpfile.js\r\nNov 15 10:05:49 ubuntu2004 npm[3939]: [10:05:49] Starting 'serve'...\r\nNov 15 10:05:49 ubuntu2004 npm[3939]: [10:05:49] Starting server...\r\nNov 15 10:05:49 ubuntu2004 npm[3939]: [10:05:49] Server started http:\/\/0.0.0.0:8001\r\nNov 15 10:05:49 ubuntu2004 npm[3939]: [10:05:49] LiveReload started on port 35729\r\nNov 15 10:05:49 ubuntu2004 npm[3939]: [10:05:49] Running server\r\n<\/pre>\r\n\r\n\r\n\r\n