Zola on Full VM with Local Browser View and Source-Code Editor

Zola on Full VM with Local Browser View and Source-Code Editor

Table of Contents


Introduction

In this tutorial, we will go through all the steps needed to run Zola on a remote VM while seeing the website on a local browser and being able to work on the files directly from a source-code editor (VSCodium and VSCode).

To do so, we will create an SSH tunnel and use the Remote Explorer extension of VSCodium or VSCode.

Prerequisites

Create an SSH Tunnel

  • Open a terminal and create an SSH tunnel
    ssh -4 -L 1111:127.0.0.1:1111 root@10.20.4.2
    

Simply leave this window open and follow the next steps.

VSCode SSH remote connection

You can connect via SSH through the source-code editor to a VM on the grid. In this example, WireGuard is set.

  • Add the SSH Remote extension to VSCode or VSCodium
  • Add a new SSH remote connection
  • Set the following (adjust with your own username and host)
    Host 10.20.4.2
        HostName 10.20.4.2
        User root
    
  • Click on Connect to host

Install Zola

Once you properly connected via SSH to the VM from the source-code editor, you can install Zola:

wget https://github.com/barnumbirr/zola-debian/releases/download/v0.18.0-2/zola_0.18.0-2_amd64_bookworm.deb
dpkg -i zola_0.18.0-2_amd64_bookworm.deb

Run a Zola Website

For this example, we will set the Mycelium website.

  • Clone the Zola website repository
    git clone https://github.com/threefoldfoundation/www_mycelium
    
  • Change directory
    cd www_mycelium
    
  • Run the start script
    ./start.sh
    
  • Open your local browser and enter the following URL
    localhost:1111
    
1 Like