Yes, it is certainly fine to run DocPub as a shell command.
There is a dependency on some c++ runtimes. So my first guess, is that you are running 32bit DocPub on a 64bit server, but the server only has the 64bit versions of the runtime dependency.
Easiest solution would be to run 64bit DocPub.
See this post for more info.
If this doesn't help, then we would need full error messages, and information about the server.