Error on installing Ubuntu 16.04, Daemon not starting

Getting the following error while trying to run sudo apt-get install docker-ce in my Ubuntu 16.04 server (following https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository)

Job for docker.service failed because the control process exited with error code.
 See "systemctl status docker.service" and "journalctl -xe" for details.         
invoke-rc.d: initscript docker, action "start" failed.                           
* docker.service - Docker Application Container Engine                           
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: en
abled)                                                                           
   Active: activating (auto-restart) (Result: exit-code) since Wed 2018-03-14 16:
03:04 IST; 13ms ago                                                              
     Docs: https://docs.docker.com                                               
  Process: 4502 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILUR
E)                                                                               
 Main PID: 4502 (code=exited, status=1/FAILURE)                                  
    Tasks: 3                                                                     
   Memory: 8.6M                                                                  
      CPU: 51ms                                                                  
   CGroup: /system.slice/docker.service                                          
dpkg: error processing package docker-ce (--configure):                          
 subprocess installed post-installation script returned error exit status 1      
Errors were encountered while processing:                                        
 docker-ce                                                                       
E: Sub-process /usr/bin/dpkg returned an error code (1)                          

And Docker Daemon not starting, please help.

journalctl -xe type and paste please

journalctl -xe

[sudo] password for danimvijay:                                                                                                                                         
-- Subject: Unit docker.socket has begun start-up                                                                                                                       
-- Defined-By: systemd                                                                                                                                                  
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel                                                                                                 
--                                                                                                                                                                      
-- Unit docker.socket has begun starting up.                                                                                                                            
Mar 14 16:03:06 v5015 systemd[1]: Listening on Docker Socket for the API.                                                                                               
-- Subject: Unit docker.socket has finished start-up                                                                                                                    
-- Defined-By: systemd                                                                                                                                                  
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel                                                                                                 
--                                                                                                                                                                      
-- Unit docker.socket has finished starting up.                                                                                                                         
--                                                                                                                                                                      
-- The start-up result is done.                                                                                                                                         
Mar 14 16:03:06 v5015 systemd[1]: docker.service: Start request repeated too quicMar 14 16:03:06 v5015 systemd[1]: Failed to start Docker Application Container En-- Sub
ject: Unit docker.service has failed                                                                                                                                    
-- Defined-By: systemd                                                                                                                                                  
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel                                                                                                 
--                                                                                                                                                                      
-- Unit docker.service has failed.                                                                                                                                      
--                                                                                                                                                                      
-- The result is failed.                                                                                                                                                
Mar 14 16:03:06 v5015 systemd[1]: docker.socket: Unit entered failed state.                                                                                             
Mar 14 16:04:06 v5015 systemd-journald[45]: Forwarding to syslog missed 19 messag-- Subject: One or more messages could not be forwarded to syslog                      
-- Defined-By: systemd                                                                                                                                                  
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel                                                                                                 
--                                                                                                                                                                      
-- One or more messages could not be forwarded to the syslog service                                                                                                    
-- running side-by-side with journald. This usually indicates that the                                                                                                  
-- syslog implementation has not been able to keep up with the speed of                                                                                                 
-- messages queued.                                                                                                                                                     
Mar 14 16:09:01 v5015 CRON[4580]: pam_unix(cron:session): session opened for userMar 14 16:09:01 v5015 CRON[4581]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] Mar 14
 16:09:02 v5015 CRON[4580]: pam_unix(cron:session): session closed for userMar 14 16:11:01 v5015 CRON[4648]: pam_unix(cron:session): session opened for userMar 14 16:11
:01 v5015 CRON[4649]: (root) CMD (   cd / && run-parts --report /etc/Mar 14 16:11:01 v5015 CRON[4648]: pam_unix(cron:session): session closed for userMar 14 16:21:04 v5
015 sudo[4679]: danimvijay : TTY=pts/2 ; PWD=/home/danimvijay ;lines 1961-1999/1999 (END)                                                                               

systemctl status docker.service

* docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since Wed 2018-03-14 16:03:06 IST; 20min ago
     Docs: https://docs.docker.com
  Process: 4540 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 4540 (code=exited, status=1/FAILURE)

Mar 14 16:03:05 v5015 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Mar 14 16:03:05 v5015 systemd[1]: Failed to start Docker Application Container Engine.
Mar 14 16:03:05 v5015 systemd[1]: docker.service: Unit entered failed state.
Mar 14 16:03:05 v5015 systemd[1]: docker.service: Failed with result 'exit-code'.
Mar 14 16:03:06 v5015 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Mar 14 16:03:06 v5015 systemd[1]: Stopped Docker Application Container Engine.
Mar 14 16:03:06 v5015 systemd[1]: docker.service: Start request repeated too quickly.
Mar 14 16:03:06 v5015 systemd[1]: Failed to start Docker Application Container Engine.

this is same problem you can follow this way if not please write again

thanks

No luck, unfortunately.

Tried installing using binaries(https://docs.docker.com/install/linux/docker-ce/binaries/#install-static-binaries). But when entering sudo dockerd &, following error appears at the bottom

ERRO[2018-03-14T17:00:12.908428778+05:30] Could not check if docker-default AppArmor profile was loaded: open /sys/kernel/security/apparmor/profiles: permission denied
Error starting daemon: couldn't create plugin manager: error setting plugin manager root to private: permission denied

this is permission error please use sudo su and after give command
also you must disable ufw
/etc/init.d/ufw stop

Using sudo all the times, and tried with ufw disabled, still no luck. My VPS is LXC, is that have something to do with it?

Hello . Have you tried disabling apparmor?
https://help.ubuntu.com/lts/serverguide/apparmor.html

AppArmor can be disabled, and the kernel module unloaded by entering the following:

sudo systemctl stop apparmor.service

Tried it right now. Same error persists.

I’ve created simple copy/paste cheatsheet: Link. Don’t forget to uninstall existing Docker from Ubuntu repository. :wink:

Hope it will help.

I have tried many a times installing Ubuntu 16.04, Daemon is not at all installing and it is generating the error as shown below.
ERRO[2018-03-14T17:00:12.908428778+05:30] Could not check if docker-default AppArmor profile was loaded: open /sys/kernel/security/apparmor/profiles: permission denied
Error starting daemon: couldn’t create plugin manager: error setting plugin manager root to private: permission denied
Kindly help me fix the issue and help me install it without any issues. Nox