Travelling solo does have a few negatives to it. The sense of loneliness can creep up along the way which can sometimes leave you feeling a little on the downside. Obviously you will feel lonely at some point on the journey but there are ways to avoid it as much as possible.
Distract yourself by staying occupied
Sitting and staying inside at your accommodation will not help the feeling of loneliness, it will make it considerably worse. If you find yourself with a few hours in the day to spare, take a walk around, go shopping, find new friends at your accommodation and make plans with them. There's nothing worse than finding yourself stuck at your accommodation with nothing to do and no one to talk to.
Choose hostels for your accommodation
Hostels are the go to accommodation option for travellers because they're cheap, sociable and travel-friendly. This should be a no-questioner for you if you're travelling solo, especially if it's your first trip, as you'll likely meet people within 5 minutes from arriving. The social atmosphere all around will never leave you feeling lonely. There is always something going on in hostels and someone always around to talk to, even if that is staff, they're usually just as, if not friendlier and welcoming.
Make friends with fellow travellers
You're not alone in this. There will be other travellers making this journey alone which you'll bound to run in to along the way. Take this opportunity to connect with one another and join forces. I'm not saying you have to be best friends with them but take a day tour out or have dinner with them in the evenings. You'll be surprised with the amount of travellers you meet along the way. Even at airports you are likely to run into someone and get a conversation going.
Try new experiences/take part in tours
Step out of your comfort zone and try new and unique experiences which you hadn't even thought of going before. Fill those gap of doing nothing in your travels with endless fun and more adventures. It will end in a good storytelling and you probably won't be feeling lonely during these times.