> ## Content Index
> Fetch the complete content index at: https://www.process-one.net/llms.txt
> Use this file to discover other available public pages before exploring further.

# ejabberd administration from command-line, XMPP client, and more
- URL: https://www.process-one.net/blog/ejabberd-administration-from-command-line-xmpp-client-and-more/
- Published: 2009-09-22T22:00:00.000Z
- Updated: 2024-09-23T16:31:34.000Z
- Description: ejabberd has a powerful set of commands for administrative purposes that you can use on the command-line or your standard XMPP client.
- Author: ProcessOne

ejabberd provides two handy administration interfaces to execute commands:

- ejabberdctl command line script: for use in your regular terminal or via SSH
- Ad-Hoc Commands ([XEP-0050](https://xmpp.org/extensions/xep-0050.html?ref=process-one.net)): for use in your regular standard XMPP client

You can get the full list of available commands by launching the ejabberdctl command list script when ejabberd is running. For example, in ejabberd 2.1.0, you have those commands:

$ ejabberdctl  
Usage: ejabberdctl \[--node nodename\] \[--auth user host password\] command \[options\]Available commands in this ejabberd node  
backup file  
Store the database to backup file  
connected\_users  
List all established sessions  
connected\_users\_number  
Get the number of established sessions  
delete\_expired\_messages  
Delete expired offline messages from database  
delete\_old\_messages days  
Delete offline messages older than DAYS  
dump file  
Dump the database to text file  
dump\_table file table  
Dump a table to text file  
export\_piefxis dir  
Export data of all users in the server to PIEFXIS files (XEP-0227)  
export\_piefxis\_host dir host  
Export data of users in a host to PIEFXIS files (XEP-0227)  
get\_loglevel  
Get the current loglevel  
help \[--tags \[tag\] | com?\*\]  
Show help (try: ejabberdctl help help)  
import\_dir file  
Import users data from jabberd14 spool dir  
import\_file file  
Import user data from jabberd14 spool file  
import\_piefxis file  
Import users data from a PIEFXIS file (XEP-0227)  
incoming\_s2s\_number  
Number of incoming s2s connections on the node  
install\_fallback file  
Install the database from a fallback file  
load file  
Restore the database from text file  
mnesia \[info\]  
show information of Mnesia system  
mnesia\_change\_nodename oldnodename newnodename oldbackup newbackup  
Change the erlang node name in a backup file  
outgoing\_s2s\_number  
Number of outgoing s2s connections on the node  
register user host password  
Register a user  
registered\_users host  
List all registered users in HOST  
rename\_default\_nodeplugin  
Update PubSub table from ejabberd trunk SVN to 2.1.0  
reopen\_log  
Reopen the log files  
restart  
Restart ejabberd  
restore file  
Restore the database from backup file  
status  
Get ejabberd status  
stop  
Stop ejabberd  
unregister user host  
Unregister a user  
user\_resources user host  
List user's connected resources

Examples:

ejabberdctl restart ejabberdctl --node ejabberd@host restart  
  
Commands to start an ejabberd node: start Start an ejabberd node in server mode debug Attach an interactive Erlang shell to a running ejabberd node live Start an ejabberd node in live (interactive) mode

You also have access to all these commands with any standard XMPP client that supports Ad-Hoc Commands, and [XEP-0004: Data Forms](https://xmpp.org/extensions/xep-0004.html?ref=process-one.net). Of course your Jabber account must have admin privilege in ejabberd to execute the commands.

![image](https://www.process-one.net/images/uploads/admin1_ad-hoc.png)

The dialog box for Ad-Hoc Commands, and below, the list of available commands:

![image](https://www.process-one.net/images/uploads/admin2_ad-hoc_list.png)

In addition to the ejabberdctl script and the XMPP client interface, you can execute commands in several other ways if you install the corresponding modules:

- ejabberd\_xmlrpc allows XML-RPC calls
- mod\_rest allows HTTP POSTs
- mod\_shcommands provides a new page in ejabberd’s WebAdmin
- service discovery

Here is the service discovery under Psi+:

![image](https://www.process-one.net/images/uploads/admin3_disco.png)

Here is the ejabberd’s WebAdmin interface:

![image](https://www.process-one.net/images/uploads/mod_shcommands-ctl.png)

And finally, you can install mod\_admin\_extra, which provides many more commands for specific tasks, like modify roster, vCard, and shared roster groups. There is also mod\_muc\_admin, which provides commands to administer the MUC service: create, destroy, list, configure rooms…

Note: the concepts and features described in this post apply to ejabberd 2.1.0 and newer. Older versions do not include all the commands described here.