HowTo: Run Docusaurus With Incus
NEED: I had the need to run docusaurus in my laptop, but I didn't want to install npm locally
SOLUTION: Use an incus server to run docusaurus and be able to see the output locally
ASSUMPTIONS:
- I'm running a linux mint server (these instructions must be the same for ubuntu)
- I cloned the repository https://github.com/bxservice/idempiere-rest-docs into my folder /home/carlos/gitIdempiere/idempiere-rest-docs like this
cd /home/carlos/gitIdempiere git clone git@github.com:bxservice/idempiere-rest-docs
So, these are the instructions that I needed to run docusaurus within an incus instance:
Of course the first is to install incus:
sudo apt-get install incus
Then I needed to execute these two instructions because I have docker also installed in my system (they are probably not needed if you don't have docker):
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
Then launch an image server to run docusaurus within:
incus launch images:mint/wilma/default docusaurus
The following instruction associates the local folder to be the same in the incus server:
incus config device add docusaurus idempiere-rest-docs disk source=/home/carlos/gitIdempiere/idempiere-rest-docs path=/home/carlos/gitIdempiere/idempiere-rest-docs shift=true
And this instruction forward the port 3000 from docusaurus to my laptop:
incus config device add docusaurus port3000 proxy listen=tcp:0.0.0.0:3000 connect=tcp:127.0.0.1:3000
Then I log into the docusaurus mint server just created:
incus exec docusaurus bash
Within that server I needed to first to install curl:
apt-get install -y curl
And then as the ubuntu user run the instructions to install nodejs and execute docusaurus there:
su - ubuntu curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash \. "$HOME/.nvm/nvm.sh" nvm install 22 node -v # Should print "v22.19.0". npm -v # Should print "10.9.3". cd /home/carlos/gitIdempiere/idempiere-rest-docs npm install npm start -- --host 0.0.0.0
At this point you can navigate to http://localhost:3000/idempiere-rest-docs/ and you must be able to see the docusaurus pages.
CLEANUP
At the end if you want to clean everything you installed you can push Control-C to stop the docusaurus, and then:
exit exit
At this point you must be in your desktop, clean what you used:
incus stop docusaurus incus delete docusaurus
if you want also to remove the mint image:
incus image list
it must show something like
+-------+--------------+--------+-------------------------------------+--------------+-----------+-----------+-----------------------+ | ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCHITECTURE | TYPE | SIZE | UPLOAD DATE | +-------+--------------+--------+-------------------------------------+--------------+-----------+-----------+-----------------------+ | | 16da9870be86 | no | Mint wilma amd64 (20250829_08:51) | x86_64 | CONTAINER | 132.56MiB | 2025/08/29 12:48 CEST | +-------+--------------+--------+-------------------------------------+--------------+-----------+-----------+-----------------------+
and you can delete the mint image with:
incus image delete 16da9870be86