This article explains how to access iMessage on iCloud. Since the iOS 11.4 update was released, iMessage messages are now also available on iCloud. This means they are synced across all devices. Messages you receive or delete on iPhone will also be transferred to your Mac or iPad. Before setting up iMessage on iCloud, remember that all old messages will no longer be available.
Steps
Method 1 of 2: On an iPhone or iPad

Step 1. Update to iOS 11.4
If you haven't already, update the iPhone's operating system to iOS 11.4 or later. Read this article to know how to get the latest version on iPhone or iPad.

Step 2. Open the "Settings" application
The icon is represented by two gears and is located on the home screen.

Step 3. Tap your name
It's at the top of the "Settings" menu, next to your profile photo. The menu associated with your Apple ID will open.

Step 4. Tap
iCloud next to the blue speech bubble icon.

Step 5. Tap the button
next to
The "Messages" or "iMessage" application has a green icon containing a white speech bubble. This will enable iMessage message storage on iCloud.
Method 2 of 2: On a Mac

Step 1. Update to MacOS High Sierra
If you don't have the latest version of MacOS, you will need to upgrade to macOS 10.13.5 to activate iMessage on iCloud. On this site you will find more information about it.

Step 2. Open "Messages"
The icon is represented by two overlapping speech bubbles.

Step 3. Click on Messages
After opening the "Messages" application, you will find this option in the upper right corner of the menu bar.

Step 4. Click Preferences
It is located in the "Messages" menu and allows you to open the settings application.

Step 5. Click on the Accounts tab
It is the second tab at the top of the "Preferences" window. It is represented by a blue circle with a white snail ("@") in the center.

Step 6. Check the "Enable Messages on iCloud" box
In the "Preferences" window, under the "Accounts" tab you will find this box to enable archiving of iMessage messages to iCloud.