Redis-stack-server: redis-stack.conf read only

I install redis-stack-server on Ubuntu by snap:

sudo apt update
sudo apt install redis-tools
sudo snap install --dangerous --classic <snapname.snap>

then edit the /etc/systemd/system/redis-stack-server.service file and enter the following information:

[Unit]
Description=Redis Stack Server
After=network.target

[Service]
ExecStart=/usr/bin/snap run redis-stack-server
Restart=always
User=root
Group=root

[Install]
WantedBy=multi-user.target

finally run the following commands.

sudo systemctl daemon-reload
sudo systemctl start redis-stack-server
sudo systemctl enable redis-stack-server

After that I can use redis-stack, but I find I can’t edit the config file: /snap/redis-stack-server/x1/opt/redis-stack/etc/redis-stack.conf which is a readonly file. so how shall I do that?

That snap does not seem to be in the snap store at all … and it is a --classic snap which means is runs fully unconfined and through that has full root access to your system… installing it with --dangerous means even if it would show up in the store at some point it would not be upgraded, is not verified or signed …

Since it does not really follow the typical packaging and security policies, it is hard to say anything about it (properly packaged snaps will never require anything like manually creating systemd units and would use an install hook to put their config into their writable space) … you should ask where you downloaded the snap since only these people will know details about it …