By the way. Another way is to not boot to run level 5 / graphical but tell systemd to only to say level 3. If your in 5 you can also tell it to go to say 3. I cannot remember the commands but maybe someone else does.
If you did not know Linux boot system defines 6 run levels 0…5. You can boot to any of them. 0 is shutdown, 1 is emergency/single user, 3 is usually non-graphical mode, 5 is usually graphical. How you use them depends on your Linux distribution and if it uses systemd.