How to: Stop X.Org Server

Q. How do I start or stop X.Org from a command prompt?

A. X.org is open-source implementation of the X11 system. It is an open source X11-based desktop infrastructure. Xorg provides an interface between your hardware and the graphical software you want to run. Besides that, Xorg is also fully network-aware, meaning you are able to run an application on one system while viewing it on a different one.

Start X.Org Server

There are two ways, just type startx:
$ startx
Alternatively, run init script such as /etc/init.d/gdm
# /etc/init.d/gdm start
OR
$ sudo /etc/init.d/gdm start

Ctrl+Alt+Backspace – to stop server

Press Ctrl+Alt+Backspace to immediately kill the server – no questions asked.

Agian, you can use init script to stop session:
# /etc/init.d/gdm stop
OR
$ sudo /etc/init.d/gdm stop


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 7 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
7 comments… add one
  • Binny V A Nov 13, 2007 @ 18:10

    Another method is to change the runlever…
    init 3 – turn off X
    init 5 – turn on X

  • d Oct 15, 2009 @ 17:02

    didn’t work for ubuntu 9.04 at all !! could start but nit stop :-(
    and neither did the runlevels changes using init

  • kablah Dec 17, 2010 @ 4:40

    Doesn’t work for kubuntu 10.10 either

    • linuxn00b Feb 10, 2011 @ 5:56

      For kubuntu, you would need to replace gdm with kdm, i believe

  • helps Feb 22, 2011 @ 22:56

    this was disabled for several versions now, use this first:
    setxkbmap -option terminate:ctrl_alt_bksp
    then you can use the keystrokes

  • Bob Mar 20, 2011 @ 4:39

    Several reasons? I just want to turn off X so that I can run the Nividia script!! i don’t understand why this has to be so difficult.

  • Brian Sep 13, 2011 @ 15:33

    Setting init 3 (after hitting CTRL+ALT+F2 at login screen) did it for me so I was able to install the drivers.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum