How to disable Xserver autostart? I tried
update-rc.d -f gdm remove
but after reboot it started again...
There are a number of ways to do this, from relatively clean to completely messed up... (I won't touch upon the latter :-)
Using update-rc.d to forcibly remove an init script may work if you remove the right ones, however they may be placed back once you or the system performs an upgrade.
You may want to try and remove gdm3 as well:
update-rc.d -f gdm3 remove
Consider instead of removing it to just change whether it starts or not:
update-rc.d example stop 20 2 3 4 5 .
You could also consider purging all X stuff if you don't need it at all:
apt-get --purge remove xserver-xorg* gnome-desktop-environment
You could run the system in single user mode, aka rescue mode, run level 1. Make sure to start things such as networking by hand.
With systemd on Debian 9, the command is:
systemctl set-default multi-user.target
Source: https://wiki.debian.org/GDM