code: @RequirePOST
      public void doCreateFirstAccount(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
          if(hasSomeUser()) {
              rsp.sendError(SC_UNAUTHORIZED,"First user was already created");
              return;
          }
          User u = createAccount(req, rsp, false, "firstUser.jelly");
          if (u!=null) {
              tryToMakeAdmin(u);
              loginAndTakeBack(req, rsp, u);
          }
      }
docs: Creates a first admin user account.
  
  <p>
  This can be run by anyone, but only to create the very first user account.