Set up a development environment for Mainsail
At this point you should have already forked Mainsail into your repositories.
If that is not the case, go ahead and fork Mainsail now.
.env.development.local.example file and omit the
.example at the end.
The file is located in the root directory of the Mainsail project.
Now edit the
.env.development.local file to reflect your printers network configuration.
Example: If the IP of your printer is
192.168.1.10, modify it like this:
# hostname or ip from the moonraker instance VUE_APP_HOSTNAME=192.168.1.10
You need to set
VUE_APP_HOSTNAME=localhost in case you want to use a Virtual-Klipper-Printer.
For Moonraker, you need to add your local IP to the
cors_domains section inside the
cors_domains: *//<your local ip>:<local port>
Example: If the IP of your PC you develop Mainsail on is
Port 8080 is the default port
npm will serve the development server on.
You can download NodeJS from here.
Pick your preferred installation package.
Make sure you run node >=15.9.0
Open your preferred terminal application and navigate into the Mainsail root directory.
Run the following command to install all required modules and dependencies:
Afterwards run the following command to start a local development server:
npm run serve
Once the server is up and running, you can access Mainsail on
It is possible to develop Mainsail with a virtual printer running inside a Docker container.
We created a special project for that, which you can find here.
To use our Virtual-Klipper-Printer project, it is required to have Docker installed.
Below are some general resources on how to get Docker.
After Docker is installed, follow the instructions here to get everything up and running.