I'm going to run my own jabber server on my Ubuntu server.
Should I use rather ejabberd
or jabberd2
daemon?
Which of them is better?
What are the differences between them?
It depends very much on your needs. What are your expectations? General comparison is available on Wikipedia
If you're just looking for a simple xmpp server for your private server, I would recommend Prosody. It's lightweight, easy to configure, supports SSL, and has a helpful community. You can get it up and running literally in minutes.