§2024-08-24

Creating an admin account in Rocket.Chat is a straightforward process. You can do this either during the initial setup of Rocket.Chat or after the installation is complete. Here’s how to create an admin account in both scenarios:

  1. During Initial Setup

When you first install Rocket.Chat, you’ll be guided through a setup wizard that includes creating the first admin account. Follow these steps:

- Access Rocket.Chat: Open your web browser and navigate to your Rocket.Chat instance (e.g., http://your-server-address:3000).

- Setup Wizard:
    When you access Rocket.Chat for the first time, you will see the setup wizard.
    Follow the on-screen instructions to configure basic settings.

- Create Admin Account:
    During the setup process, you’ll be prompted to create the first admin account.
    Enter the necessary details such as username, email, and password.
    This account will have administrative privileges by default.

- Complete Setup: Finish the setup process and log in with your newly created admin account.
  1. After Installation

If you need to create an admin account after Rocket.Chat is already installed, follow these steps: Using the Rocket.Chat Interface

- Log In: Access Rocket.Chat using an existing admin account or a user account with sufficient permissions.

-Open Administration Panel:
    Click on your profile picture or username in the upper-right corner.
    Select "Administration" from the dropdown menu.

Go to Users Section:
    In the Administration panel, go to the "Users" section.

Create a New User:
    Click "New User" or "Add User".
    Fill in the details for the new user, such as username, email address, and password.

Assign Admin Role:
    After creating the user, find the user in the list and click on their username to edit their profile.
    Go to the "Roles" or "Permissions" tab.
    Assign the "admin" role to the user. This will grant them administrative privileges.

Save Changes: Save the changes to update the user’s roles and permissions.

Using MongoDB Command Line

If you don't have access to the Rocket.Chat interface but have access to the server's MongoDB database, you can create an admin account via MongoDB commands:

    $ mongosh "mongodb://siteRootAdmin:b23258585@x8664Arch.yushei.com.tw:27017,hc4Jammy.yushei.com.tw:27017,n2Jammy.yushei.com.tw:27017/YuSheiDBTest?replicaSet=odroid01&authSource=admin"
Current Mongosh Log ID: 66c94d363d1cdac6108db5fa
Connecting to:          mongodb://<credentials>@x8664Arch.yushei.com.tw:27017,hc4Jammy.yushei.com.tw:27017,n2Jammy.yushei.com.tw:27017/YuSheiDBTest?replicaSet=odroid01&authSource=admin&appName=mongosh+2.2.6
Using MongoDB:          7.1.0-alpha
Using Mongosh:          2.2.6
mongosh 2.3.0 is available for download: https://www.mongodb.com/try/download/shell

For mongosh info see: https://docs.mongodb.com/mongodb-shell/

------
   The server generated these startup warnings when booting
   2024-08-18T05:01:37.760+08:00: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never'
   2024-08-18T05:01:37.760+08:00: vm.max_map_count is too low
------

odroid01 [primary] YuSheiDBTest> show databases
Learn           40.00 KiB
WuShunDB       216.00 KiB
YuSheiDBTest     2.11 GiB
YuSheiERP       40.00 KiB
admin          220.00 KiB
config         424.00 KiB
local            4.60 GiB
syslog_ng_db  1004.00 KiB
ys_blog        224.00 KiB
odroid01 [primary] YuSheiDBTest>   <- YuSheiDBTest is the Rocket.Chat DB
  1. Verifying Admin Access

After creating an admin account, log in to Rocket.Chat with the new account to verify that it has administrative privileges:

Log In: Use the new admin credentials to log in to Rocket.Chat.

Check Admin Panel: Verify that you can access the Administration panel and manage settings.

By following these steps, you can create and manage admin accounts in Rocket.Chat, ensuring that you have the necessary administrative control over your communication platform.


he Rocket.Chat interface is the web-based platform that users interact with to manage and use the Rocket.Chat service. You can access and navigate the Rocket.Chat interface using a web browser. Here’s where you can find and use the various parts of the Rocket.Chat interface: Accessing the Rocket.Chat Interface

Open a Web Browser: Use any modern web browser such as Google Chrome, Mozilla Firefox, Microsoft Edge, or Safari.

Navigate to Rocket.Chat URL: Enter the URL of your Rocket.Chat instance in the browser’s address bar. This URL will typically look something like http://your-server-address:3000 or https://your-server-address if using HTTPS.
    For example: http://chat.example.com or https://chat.example.com

Login Screen: If you are not logged in yet, you will see the login screen where you can enter your credentials. If you don’t have an account yet, you might need to create one or contact your administrator.

Key Areas of the Rocket.Chat Interface

Home Screen:
    After logging in, you are typically taken to the home screen where you can see a list of channels, direct messages, and groups.
    You can also search for specific users or channels.

Sidebar:
    Channels: View and access various channels you're a member of.
    Direct Messages: View and access direct messages with individual users.
    Groups: Access any group conversations.
    Apps: Access integrated apps and bots (if applicable).

Channel/Group View:
    When you click on a channel or group, you are taken to that conversation view where you can see messages, post new messages, and interact with other users.

User Profile:
    Click on your profile picture or username in the upper-right corner to access profile settings, preferences, and logout options.

Administration Panel (For Admin Users):
    Access: Click on your profile picture or username in the upper-right corner and select "Administration".
    Features: In the Administration panel, you can manage settings, users, permissions, integrations, and more.
    Settings: Access various configuration settings for your Rocket.Chat instance.

Settings Menu:
    For user settings, click on your profile picture or username and select "My Account" or "Settings" to manage personal preferences, notifications, and account details.

Search Bar:
    Located at the top of the interface, the search bar allows you to find messages, channels, and users quickly.

Additional Features

File Sharing: You can drag and drop files into the message input area to share files within channels or direct messages.
Video Calls: If enabled, you can start or join video calls directly from the Rocket.Chat interface.
Notifications: You can manage notification settings to control how and when you receive alerts.

Accessing Rocket.Chat on Mobile

Mobile Apps: Rocket.Chat is available as a mobile app for both iOS and Android. You can download the app from the App Store or Google Play and log in using your Rocket.Chat credentials.

By using the Rocket.Chat interface, you can effectively communicate, collaborate, and manage your Rocket.Chat workspace or server. If you're an admin, the interface also provides tools for managing the overall configuration and user roles within your Rocket.Chat instance.

{
    _id: 'aRpfPndMvcNK2fkvn',
    createdAt: ISODate('2024-08-24T03:37:53.598Z'),
    services: {
      password: {
        bcrypt: '$2b$10$hKOO3YmR4bKXCGoEAGOowucpL2uETojIFR/pRv8lDB5gIpOUwZm2m'
      },
      email2fa: { enabled: true, changedAt: ISODate('2024-08-24T03:37:53.598Z') },
      email: {
        verificationTokens: [
          {
            token: 'awvJwEDpE3oVXnYFVpTpfNhf_AYIBN4H1bdmrzqSFUG',
            address: 'rai.sousuke@gmail.com',
            when: ISODate('2024-08-24T03:37:53.734Z')
          }
        ]
      },
      resume: {
        loginTokens: [
          {
            when: ISODate('2024-08-24T03:37:54.749Z'),
            hashedToken: '5+f23QwVr0tBqdoGFie1EVCoWcpfiZpwqlsdVXkNNqQ='
          }
        ]
      }
    },
    emails: [ { address: 'rai.sousuke@gmail.com', verified: false } ],
    type: 'user',
    roles: [ 'user' ],
    status: 'online',
    active: true,
    _updatedAt: ISODate('2024-08-24T03:37:55.836Z'),
    name: 'YsRocketChatAdmin',
    username: 'YsRocketChatAdmin',
    __rooms: [ 'GENERAL' ],
    lastLogin: ISODate('2024-08-24T03:37:55.013Z'),
    statusConnection: 'online',
    utcOffset: 8
  }
]

odroid01 [primary] YuSheiDBTest> 

db.users.update(
          { username: "YsRockeChatAdmin" },
          {
            $set: {
              username: "YsRocketChatAdmin",
              email: "your-email",
              services: {
                password: {
                  bcrypt: "$2a$10$your-encrypted-password"
                }
              },
              roles: ["admin"]
            }
          },
          { upsert: true }
        );
odroid01 [primary] YuSheiDBTest> db.users.find({ name: "YsRocketChatAdmin"})
[
  {
    _id: 'aRpfPndMvcNK2fkvn',
    createdAt: ISODate('2024-08-24T03:37:53.598Z'),
    services: {
      password: {
        bcrypt: '$2b$10$hKOO3YmR4bKXCGoEAGOowucpL2uETojIFR/pRv8lDB5gIpOUwZm2m'
      },
      email2fa: { enabled: true, changedAt: ISODate('2024-08-24T03:37:53.598Z') },
      email: {
        verificationTokens: [
          {
            token: 'awvJwEDpE3oVXnYFVpTpfNhf_AYIBN4H1bdmrzqSFUG',
            address: 'rai.sousuke@gmail.com',
            when: ISODate('2024-08-24T03:37:53.734Z')
          }
        ]
      },
      resume: {
        loginTokens: [
          {
            when: ISODate('2024-08-24T03:37:54.749Z'),
            hashedToken: '5+f23QwVr0tBqdoGFie1EVCoWcpfiZpwqlsdVXkNNqQ='
          }
        ]
      }
    },
    emails: [ { address: 'rai.sousuke@gmail.com', verified: false } ],
    type: 'user',
    roles: [ 'user' ],
    status: 'online',
    active: true,
    _updatedAt: ISODate('2024-08-24T03:37:55.836Z'),
    name: 'YsRocketChatAdmin',
    username: 'YsRocketChatAdmin',
    __rooms: [ 'GENERAL' ],
    lastLogin: ISODate('2024-08-24T03:37:55.013Z'),
    statusConnection: 'online',
    utcOffset: 8
  }
]

db.users.update(
  { name: "YsRocketChatAdmin" },
  { $set: { roles: ["admin"] } }
)

db.users.update(
  { name: "YsRocketChatAdmin" },
  { $addToSet: { roles: "admin" } }
)

odroid01 [primary] YuSheiDBTest> db.users.update(
...   { name: "YsRocketChatAdmin" },
...   { $set: { roles: ["admin"] } }
... )
DeprecationWarning: Collection.update() is deprecated. Use updateOne, updateMany, or bulkWrite.
{
  acknowledged: true,
  insertedId: null,
  matchedCount: 1,
  modifiedCount: 1,
  upsertedCount: 0
}
odroid01 [primary] YuSheiDBTest> db.users.find({ name: "YsRocketChatAdmin"})
[
  {
    _id: 'aRpfPndMvcNK2fkvn',
    createdAt: ISODate('2024-08-24T03:37:53.598Z'),
    services: {
      password: {
        bcrypt: '$2b$10$hKOO3YmR4bKXCGoEAGOowucpL2uETojIFR/pRv8lDB5gIpOUwZm2m'
      },
      email2fa: { enabled: true, changedAt: ISODate('2024-08-24T03:37:53.598Z') },
      email: {
        verificationTokens: [
          {
            token: 'awvJwEDpE3oVXnYFVpTpfNhf_AYIBN4H1bdmrzqSFUG',
            address: 'rai.sousuke@gmail.com',
            when: ISODate('2024-08-24T03:37:53.734Z')
          }
        ]
      },
      resume: {
        loginTokens: [
          {
            when: ISODate('2024-08-24T03:37:54.749Z'),
            hashedToken: '5+f23QwVr0tBqdoGFie1EVCoWcpfiZpwqlsdVXkNNqQ='
          }
        ]
      }
    },
    emails: [ { address: 'rai.sousuke@gmail.com', verified: false } ],
    type: 'user',
    roles: [ 'admin' ],
    status: 'online',
    active: true,
    _updatedAt: ISODate('2024-08-24T03:37:55.836Z'),
    name: 'YsRocketChatAdmin',
    username: 'YsRocketChatAdmin',
    __rooms: [ 'GENERAL' ],
    lastLogin: ISODate('2024-08-24T03:37:55.013Z'),
    statusConnection: 'online',
    utcOffset: 8
  }
]
odroid01 [primary] YuSh