'Error running shiny-server

I try to run shiny server from terminal in Ubuntu but I receive this error:

nik@nik-VirtualBox:~$ shiny-server
[2017-02-13 10:42:28.353] [INFO] shiny-server - Shiny Server v1.5.1.834 (Node.js v6.9.1)
[2017-02-13 10:42:28.362] [INFO] shiny-server - Using config file "/etc/shiny-server/shiny-server.conf"
[2017-02-13 10:42:28.508] [ERROR] shiny-server - Error loading config: The user 'nik' does not have permissions to run applications as one of the users in 'shiny'. Please restart shiny-server as one of the users in  'shiny'. (/etc/shiny-server/shiny-server.conf:2:1)
[2017-02-13 10:42:28.510] [INFO] shiny-server - Shutting down worker processes

What can I do to run an app in shiny-server?

new error:

nik@nik-VirtualBox:~$ sudo shiny-server
[sudo] password for nik: 
[2017-02-14 01:56:52.913] [INFO] shiny-server - Shiny Server v1.5.1.834 (Node.js v6.9.1)
[2017-02-14 01:56:52.922] [INFO] shiny-server - Using config file "/etc/shiny-server/shiny-server.conf"
[2017-02-14 01:56:53.055] [WARN] shiny-server - Running as root unnecessarily is a security risk! You could be running more securely as non-root.
[2017-02-14 01:56:53.064] [INFO] shiny-server - Starting listener on 0.0.0.0:3838
[2017-02-14 01:56:53.080] [ERROR] shiny-server - HTTP server error (0.0.0.0:3838): listen EADDRINUSE 0.0.0.0:3838
[2017-02-14 01:56:53.081] [INFO] shiny-server - Shutting down worker processes


Solution 1:[1]

Shiny server has a configuration file. By default user name is shiny. There is no user shiny in your system so server refuses to start. I solved the problem in the following way.

sudo nano /etc/shiny-server/shiny-server.conf

There is a line:

run_as shiny;

Change shiny to a legit username, then restart shiny server:

sudo systemctl restart shiny-server

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Eugene Vlasov