This is how to install portainer on the swarm you created using this gist note this should work on non-swarm installs too!
Download the portain stack yaml that will do this for you
curl -L https://downloads.portainer.io/ce2-17/portainer-agent-stack.yml -o portainer-agent-stack.yml
now run it
sudo docker stack deploy -c portainer-agent-stack.yml portainer
this will create a single portainer container that runs on the management node and deploy the agent to all worker nodes, once complete you can now access portainer at http://docker-host-ip:9000 and define your admin users etc
You now have a fully function docker swarm with portainer and can deploy containers, stacks or templates.
How to use portainer is beyond the scope of this gist
This is the portainer install doc at time of writing for reference but the instructions above will work just fine
I got the following from the Portainer folks which should be in line with what i wrote
Hello! That’s correct. If the node running Portainer goes down, you’ll lose access to Portainer as well. We typically recommend, if possible, running the Portainer server outside of your swarm on a dedicated Docker standalone host and connecting the swarm via an agent. If you decide to keep Portainer within the swarm, ensure that, in the event it goes down, another node can access the Portainer data—usually through a network share. However, please note that storing Portainer’s data on a network share can have issues as databases and network shares can be hit and miss