How can I get tasks to complete when not logged in to the CP?
To reiterate what has been said in the comments above and to present an answer, the best way to ensure that queue jobs are completed even without the CMS being logged into or the site being visited is using a scheduled cron job.

The following will run all jobs in the queue every 10 minutes:

*/10 * * * * /usr/bin/php /path/to/craft queue/run