How can a user with a password be created in the server?

I need to be able to create a user in the server directory that can be login to and only is created the fist time the sever starts.

Assuming you have accounts-password added then you can:

      username: 'Bob123',
      password: '123Bob'
1 Like


Meteor.startup(() => {
  if (!Meteor.users.findOne({username: 'admin'})) {
    let id = Accounts.createUser({
      username: 'admin',
      email: 'admin',
      password: 'admin'


EDIT: haha, both of us probably copy-pasting it out of the same one project we’re currently working on :smiley:

1 Like