 			else
 				knex('app').insert(app)
 		.tap (container) ->
-			console.log('Starting container:', app.imageId)
+			utils.mixpanelTrack('Application start', app)
+			logSystemEvent('Starting application ' + app.imageId)
+			updateDeviceInfo(status: 'Starting')
 			ports = {}
 			if portList?
 				portList.forEach (port) ->


		# If there is no existing container then create one instead.
		containerPromise.catch ->
			docker.getImage(app.imageId).inspectAsync()
			.catch (error) ->
				utils.mixpanelTrack('Application install', app)
				logSystemEvent('Installing application ' + app.imageId)
				updateDeviceInfo(status: 'Downloading')
				dockerUtils.fetchImageWithProgress app.imageId, (progress) ->
					updateDeviceInfo(download_progress: progress.percentage)
				.then ->
					docker.getImage(app.imageId).inspectAsync()
			.then (imageInfo) ->
				console.log('Creating container:', app.imageId)
				updateDeviceInfo(status: 'Starting')
				ports = {}
				if portList?
					portList.forEach (port) ->

				return !_.isEqual(remoteApps[imageId], localApps[imageId])
			console.log(toBeUpdated)

			# Fetch any updated images first
			Promise.map toBeInstalled, (imageId) ->
				app = remoteApps[imageId]
				fetch(app)
			.then ->
				# Then delete all the ones to remove in one go
				Promise.map toBeRemoved, (imageId) ->
					kill(apps[imageId])
			.then ->
				# Then install the apps and add each to the db as they succeed
				installingPromises = toBeInstalled.map (imageId) ->
