I’m developing a custom web interface to monitor and manage my NanoPi Neo2, which is currently running the latest version of DietPi.
My goal is to perform some system management tasks directly from the web UI, such as:
Creating and restoring backups (similar to what dietpi-backup does).
Changing the network configuration (especially static IP address changes).
Applying those changes at the OS level automatically — ideally without having to log in via SSH.
Before I start implementing this, I’d like to know:
Is there any official or documented API (HTTP, REST, or internal DietPi API) that allows triggering actions like dietpi-backup or dietpi-config programmatically?
If not, is there a recommended way to safely trigger these DietPi tools (backup, restore, or IP change) from a custom web app — for example, through a systemd service, command wrapper, or some existing DietPi web endpoint?
Are there any security considerations or limitations when automating these actions through a web interface?
Would modifying configuration files directly (e.g., /boot/dietpi.txt or /etc/network/interfaces.d/) and then restarting services be considered safe for IP changes?
In short, I’d like to build a lightweight web API layer on top of DietPi for system management tasks, but I want to ensure I’m doing it in a way that’s supported, secure, and compatible with DietPi updates.
Any documentation, examples, or suggestions on how to properly integrate this would be greatly appreciated.
You would need to be able to execute shell commands from whatever backend you use. Most DietPi tools can be used unattended
of course this will introduce a new layer of security risk due to the web interface. You would need to ensure correct usage without a possibility to manipulate the input or access ways.
Hi, I’m building a fan controller using a dietpi os. I want to control some parameters such as backup, IP address, time zone, and others. For that reason, I’m developing an API to make those changes in the operating system.
Hi, creator of DietPi-Dashboard here. In versions before the rework, you could interact with the DietPi-Dashboard API through a websocket. At the moment, unless you want to parse HTML pages, there is no HTTP or similar API.
I would highly recommend contributing to the official DietPi-Dashboard. At the very least, I will always accept well-thought-out ideas to implement myself. I agree that it would be good to have integration with dietpi-backup, and there is already a request for fan controlling. My time that I have to work on it is intermittent, but MichaIng and others are always making sure that it is compatible with the latest DietPi updates.
Otherwise, everything Joulinar said is correct. I want to stress that those are all considerations we have made in DietPi-Dashboard, It is already used by many DietPi users, and it has a good framework to add additional features like you suggest. However, if you really want to write your own piece of software, then feel free to look at and adapt the DietPi-Dashboard’s method of calling DietPi tools autonomously.
I also want to note that your first post looks to be AI generated/assisted/translated. I have no issues with that itself, but I want to make sure that we’re on the same page about what you’re trying to achieve. You are unlikely to find too much support working on your own and starting from scratch, but these are features that would fit really well into the preexisting DietPi-Dashboard.
If you can’t tell, I really would enjoy more contributors on the dashboard
Thanks for taking the time to answer my question. I’m designing a custom dashboard for a fan sensor that works with DietPi. For that reason, I don’t need a full dashboard — just one for monitoring sensors and changing basic stuff like the IP address and other settings. As for AI, I’m using it mainly for translation.
In your initial post you made the vision for your dashboard sound much more complicated, which is why I suggested contributing to the official dashboard. As it stands, I still think that integrating the things you want to do into DietPi-Dashboard is the best way, as we would like to accomplish them anyways.
I just looked back at the request for fan status monitoring, and the solution that I came up with was to allow users to use custom commands to view data on the dashboard. I don’t know exactly what fan you’re using, but I think it would have some sort of CLI to monitor speed. That is probably the solution that we’ll land on when we implement this sort of thing into DietPi-Dashboard. If you want to create your own web dashboard, by all means go ahead, but there are probably simpler, better-supported methods .